turbodesk-livechat-react-native 0.1.0-alpha.24 → 0.1.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +0,0 @@
1
- /**
2
- * Returns a function to check whether a foreground FCM notification
3
- * should be suppressed because the user is already viewing that conversation.
4
- *
5
- * Usage in your FCM foreground handler:
6
- *
7
- * ```tsx
8
- * const shouldSuppress = useSuppressForegroundNotification();
9
- *
10
- * useEffect(() => {
11
- * return messaging().onMessage(async (remoteMessage) => {
12
- * const conversationId = remoteMessage.data?.conversationId;
13
- * if (shouldSuppress(conversationId)) return; // already viewing it
14
- * // otherwise show local notification
15
- * });
16
- * }, []);
17
- * ```
18
- */
19
- export declare function useSuppressForegroundNotification(): (incomingConversationId?: string | null) => boolean;
20
- //# sourceMappingURL=use-suppress-foreground-notification.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-suppress-foreground-notification.d.ts","sourceRoot":"","sources":["../../src/hooks/use-suppress-foreground-notification.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iCAAiC,KAGvC,yBAAyB,MAAM,GAAG,IAAI,KAAG,OAAO,CAIzD"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSuppressForegroundNotification = useSuppressForegroundNotification;
4
- const LiveChatContext_1 = require("../provider/LiveChatContext");
5
- /**
6
- * Returns a function to check whether a foreground FCM notification
7
- * should be suppressed because the user is already viewing that conversation.
8
- *
9
- * Usage in your FCM foreground handler:
10
- *
11
- * ```tsx
12
- * const shouldSuppress = useSuppressForegroundNotification();
13
- *
14
- * useEffect(() => {
15
- * return messaging().onMessage(async (remoteMessage) => {
16
- * const conversationId = remoteMessage.data?.conversationId;
17
- * if (shouldSuppress(conversationId)) return; // already viewing it
18
- * // otherwise show local notification
19
- * });
20
- * }, []);
21
- * ```
22
- */
23
- function useSuppressForegroundNotification() {
24
- const { activeConversationId } = (0, LiveChatContext_1.useLiveChatContext)();
25
- return (incomingConversationId) => {
26
- if (!incomingConversationId || !activeConversationId)
27
- return false;
28
- return String(incomingConversationId) === String(activeConversationId);
29
- };
30
- }
31
- //# sourceMappingURL=use-suppress-foreground-notification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-suppress-foreground-notification.js","sourceRoot":"","sources":["../../src/hooks/use-suppress-foreground-notification.ts"],"names":[],"mappings":";;AAoBA,8EAOC;AA3BD,iEAAiE;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,iCAAiC;IAC/C,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAA,oCAAkB,GAAE,CAAC;IAEtD,OAAO,CAAC,sBAAsC,EAAW,EAAE;QACzD,IAAI,CAAC,sBAAsB,IAAI,CAAC,oBAAoB;YAAE,OAAO,KAAK,CAAC;QACnE,OAAO,MAAM,CAAC,sBAAsB,CAAC,KAAK,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACzE,CAAC,CAAC;AACJ,CAAC"}
@@ -1,28 +0,0 @@
1
- import { useLiveChatContext } from "../provider/LiveChatContext";
2
-
3
- /**
4
- * Returns a function to check whether a foreground FCM notification
5
- * should be suppressed because the user is already viewing that conversation.
6
- *
7
- * Usage in your FCM foreground handler:
8
- *
9
- * ```tsx
10
- * const shouldSuppress = useSuppressForegroundNotification();
11
- *
12
- * useEffect(() => {
13
- * return messaging().onMessage(async (remoteMessage) => {
14
- * const conversationId = remoteMessage.data?.conversationId;
15
- * if (shouldSuppress(conversationId)) return; // already viewing it
16
- * // otherwise show local notification
17
- * });
18
- * }, []);
19
- * ```
20
- */
21
- export function useSuppressForegroundNotification() {
22
- const { activeConversationId } = useLiveChatContext();
23
-
24
- return (incomingConversationId?: string | null): boolean => {
25
- if (!incomingConversationId || !activeConversationId) return false;
26
- return String(incomingConversationId) === String(activeConversationId);
27
- };
28
- }