Skip to content

Commit

Permalink
updated Safari 16 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Jul 26, 2023
1 parent 03d5989 commit 6ede032
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/shared/helpers/InitHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,15 @@ export default class InitHelper {
try {
if (navigator.permissions) {
const permissionStatus = await navigator.permissions.query({ name: 'notifications' });
// NOTE: Safari 16.4 has a bug where onchange callback never fires
permissionStatus.onchange = function() {
triggerNotificationPermissionChanged();
};
}
} catch (e) {
// navigator.permissions.query({ name: 'notifications' }) currently not supported on Safari 16 (beta)
// as of June 2022
Log.warn(`Could not install native prompt permission change hook w/ error: ${e}`);
// Some browsers (Safari 16.3 and older) have the API navigator.permissions.query, but don't support the
// { name: 'notifications' } param and throws.
Log.warn(`Could not install native notification permission change hook w/ error: ${e}`);
}
}

Expand Down

0 comments on commit 6ede032

Please sign in to comment.