Skip to content

Commit

Permalink
fix: add changes for notification
Browse files Browse the repository at this point in the history
  • Loading branch information
hdz-666 committed Nov 11, 2024
1 parent bdca62e commit e03ea57
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/react-sdk/src/hooks/useAwayNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit e03ea57

Please sign in to comment.