Skip to content

Commit

Permalink
Notification: don't fail if system does not support native notifications
Browse files Browse the repository at this point in the history
iOS Safari started supporting notifications with version 16.4.
Earlier versions fail with the following error:

Can't find variable: Notification
    at requestPermission (../src/desktop/notification/DesktopNotification.ts:184:19)

355298
  • Loading branch information
cguglielmo committed Jul 28, 2023
1 parent 9826678 commit 0f1a82a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class DesktopNotification extends ScoutNotification implements DesktopNot
return;
}

if (window.Notification && Notification.permission === 'denied') {
if (!window.Notification || Notification.permission === 'denied') {
this._hideLaterIfNativeOnly();
return;
}
Expand Down

0 comments on commit 0f1a82a

Please sign in to comment.