From e03ea57c2a37401568996a9f3a384ef7d9f46560 Mon Sep 17 00:00:00 2001 From: hdz-666 <93115614+hdz-666@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:29:14 +0530 Subject: [PATCH 1/3] fix: add changes for notification --- packages/react-sdk/src/hooks/useAwayNotifications.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/react-sdk/src/hooks/useAwayNotifications.ts b/packages/react-sdk/src/hooks/useAwayNotifications.ts index 2cd5365727..02fdbe092d 100644 --- a/packages/react-sdk/src/hooks/useAwayNotifications.ts +++ b/packages/react-sdk/src/hooks/useAwayNotifications.ts @@ -17,9 +17,13 @@ export const useAwayNotifications = () => { return; } const unsubscribe = vanillaStore.subscribe(async role => { - if (role && role !== '__internal_recorder') { - await Notification.requestPermission(); - unsubscribe?.(); + try { + if (role && role !== '__internal_recorder') { + await Notification.requestPermission(); + unsubscribe?.(); + } + } catch (e) { + console.log('Error in requestPermission', e); } }, selectLocalPeerRoleName); }, [vanillaStore]); From 1f52870e18acc35f6f17ecdc242709b000dd9313 Mon Sep 17 00:00:00 2001 From: hdz-666 <93115614+hdz-666@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:44:01 +0530 Subject: [PATCH 2/3] fix: add new string --- packages/react-sdk/src/hooks/useAwayNotifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-sdk/src/hooks/useAwayNotifications.ts b/packages/react-sdk/src/hooks/useAwayNotifications.ts index 02fdbe092d..2ff7baeb48 100644 --- a/packages/react-sdk/src/hooks/useAwayNotifications.ts +++ b/packages/react-sdk/src/hooks/useAwayNotifications.ts @@ -23,7 +23,7 @@ export const useAwayNotifications = () => { unsubscribe?.(); } } catch (e) { - console.log('Error in requestPermission', e); + console.log('Error in requestPermission : ', e); } }, selectLocalPeerRoleName); }, [vanillaStore]); From c68ca4685e64ff5926fdb20822bd8e5186c60f84 Mon Sep 17 00:00:00 2001 From: hdz-666 <93115614+hdz-666@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:45:49 +0530 Subject: [PATCH 3/3] fix: add typo changes --- packages/react-sdk/src/hooks/useAwayNotifications.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-sdk/src/hooks/useAwayNotifications.ts b/packages/react-sdk/src/hooks/useAwayNotifications.ts index 2ff7baeb48..1d2cd93919 100644 --- a/packages/react-sdk/src/hooks/useAwayNotifications.ts +++ b/packages/react-sdk/src/hooks/useAwayNotifications.ts @@ -9,7 +9,7 @@ export const useAwayNotifications = () => { const requestPermission = useCallback(async () => { // Headless check for beam if (!('Notification' in window) || navigator.webdriver) { - console.debug('Request Permsissions : Notifications not supported or headless browser'); + console.debug('Request Permissions : Notifications not supported or headless browser'); // Notifications not supported return; } @@ -31,7 +31,7 @@ export const useAwayNotifications = () => { const showNotification = useCallback((title: string, options?: NotificationOptions) => { // Notifications not supported if (!('Notification' in window)) { - console.debug('Show Notifications: Notifications not supported or headless browser'); + console.debug('Show Notifications : Notifications not supported or headless browser'); return; } if (