From 36fa6b1d2ab98885e739396ed32410a38d9f79ef Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 31 Aug 2021 22:53:07 +0100 Subject: [PATCH] Improve notification --- .../notification/web-notification-popup.service.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/services/notification/web-notification-popup.service.ts b/src/app/services/notification/web-notification-popup.service.ts index c3f35da11..406761332 100644 --- a/src/app/services/notification/web-notification-popup.service.ts +++ b/src/app/services/notification/web-notification-popup.service.ts @@ -8,11 +8,7 @@ export class WebNotificationPopupService { constructor( private platform: Platform) { - var myWorker = new Worker( new URL('./sw.js', import.meta.url)); - - myWorker.onmessage = function(oEvent) { - console.log('Worker said : ' + oEvent.data); - } + navigator.serviceWorker.register(new URL('./sw.js', import.meta.url)); } @@ -53,8 +49,6 @@ export class WebNotificationPopupService { return true; } - cc = 0; - sendNotification(e) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {} else {return false} @@ -63,7 +57,7 @@ export class WebNotificationPopupService { if (result === 'granted') { navigator.serviceWorker.ready.then((registration)=> { - registration.showNotification(e.Object+ this.cc, { + registration.showNotification(e.Object, { body: e.Service, icon: 'assets/icon/favicon.png', requireInteraction: true,