client: remove notification forwarding to service worker
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This was an interim measure, but now that push notifications are always enabled, this should not be necessary any more and the service worker should receive all notifications automatically.
This commit is contained in:
parent
36031c083a
commit
8abd3ebec7
2 changed files with 0 additions and 11 deletions
|
@ -33,14 +33,6 @@ const dev: Ref<boolean> = ref(_DEV_);
|
|||
const onNotification = (notification: { type: string; id: any; }): void => {
|
||||
if ($i?.mutingNotificationTypes.includes(notification.type)) return;
|
||||
|
||||
// if push notifications are enabled there is no need to pass the notification along
|
||||
if (!instance.enableServiceWorker) {
|
||||
// service worker is not enabled or set up on the server, pass the notification along
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.active.postMessage({ type: 'notification', body: notification });
|
||||
});
|
||||
}
|
||||
|
||||
sound.play('notification');
|
||||
};
|
||||
|
||||
|
|
|
@ -164,9 +164,6 @@ self.addEventListener('message', (ev: ServiceWorkerGlobalScopeEventMap['message'
|
|||
case 'initialize':
|
||||
swLang.setLang(ev.data.lang);
|
||||
break;
|
||||
case 'notification':
|
||||
createNotification(ev.data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})());
|
||||
|
|
Loading…
Reference in a new issue