diff --git a/packages/react-sdk/src/hooks/useAwayNotifications.ts b/packages/react-sdk/src/hooks/useAwayNotifications.ts index 2cd5365727..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; } @@ -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]); @@ -27,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 (