@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 28 lines 749 Bytes
Raw
1 import type { Notification, NotificationBehavior } from "expo-notifications";
2
3 import { extractAgentNotificationDeepLink } from "./notificationPayload";
4
5 const SHOW: NotificationBehavior = {
6 shouldShowBanner: true,
7 shouldShowList: true,
8 shouldPlaySound: true,
9 shouldSetBadge: false,
10 };
11
12 const SUPPRESS: NotificationBehavior = {
13 shouldShowBanner: false,
14 shouldShowList: false,
15 shouldPlaySound: false,
16 shouldSetBadge: false,
17 };
18
19 export function foregroundNotificationBehavior(
20 notification: Notification,
21 deepLinkOnScreen: string | null,
22 ): NotificationBehavior {
23 const target = extractAgentNotificationDeepLink({ notification });
24 if (target !== null && target === deepLinkOnScreen) {
25 return SUPPRESS;
26 }
27 return SHOW;
28 }