Skip to content

Commit

Permalink
Merge "Fix "undefined is not an object (evaluating 'navigator.service…
Browse files Browse the repository at this point in the history
…Worker.controller')""
  • Loading branch information
paladox authored and Gerrit Code Review committed Dec 9, 2024
2 parents e511344 + 19ffcbb commit e02e6c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions polygerrit-ui/app/services/service-worker-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ export class ServiceWorkerInstaller extends Model<ServiceWorkerInstallerState> {
) {
this.allowBrowserNotificationsPreference =
prefs.allow_browser_notifications;
// flag can disable notifications similar to user setting
navigator.serviceWorker.controller?.postMessage({
type: ServiceWorkerMessageType.USER_PREFERENCE_CHANGE,
allowBrowserNotificationsPreference:
this.allowBrowserNotificationsPreference,
});
if (this.initialized) {
// flag can disable notifications similar to user setting
navigator.serviceWorker.controller?.postMessage({
type: ServiceWorkerMessageType.USER_PREFERENCE_CHANGE,
allowBrowserNotificationsPreference:
this.allowBrowserNotificationsPreference,
});
}
}
});
Promise.all([
Expand Down

0 comments on commit e02e6c5

Please sign in to comment.