Dateien nach "frontend/public" hochladen
This commit is contained in:
@@ -32,3 +32,23 @@ self.addEventListener('fetch', e => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.addEventListener('push', event => {
|
||||||
|
if (!event.data) return;
|
||||||
|
let data = {};
|
||||||
|
try { data = event.data.json(); } catch { data = { title:'Neue Nachricht', body: event.data.text() }; }
|
||||||
|
event.waitUntil(
|
||||||
|
self.registration.showNotification(data.title || 'DickenDock', {
|
||||||
|
body: data.body || '',
|
||||||
|
icon: data.icon || '/favicon.svg',
|
||||||
|
badge: '/favicon.svg',
|
||||||
|
tag: 'message',
|
||||||
|
renotify: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('notificationclick', event => {
|
||||||
|
event.notification.close();
|
||||||
|
event.waitUntil(clients.openWindow('/'));
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user