v1.5.2 - Notification fixes
This commit is contained in:
parent
adfedee25f
commit
2a5a194604
|
@ -25,7 +25,6 @@ const assets = [
|
|||
'/images/logos/Logo-hvid.svg',
|
||||
'/images/logos/Logo-normal.svg',
|
||||
'/images/icons/Logout.svg'
|
||||
|
||||
];
|
||||
|
||||
// install event
|
||||
|
@ -88,7 +87,18 @@ self.addEventListener('push', function(event) {
|
|||
event.waitUntil(self.registration.showNotification(msg.title, {
|
||||
body: msg.body,
|
||||
icon: msg.icon,
|
||||
badge: msg.badge,
|
||||
actions: msg.actions
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener('notificationclick', (event) => {
|
||||
event.notification.close();
|
||||
|
||||
if (event.action === 'some_action') {
|
||||
self.clients.openWindow('/home');
|
||||
} else {
|
||||
self.clients.openWindow('/')
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue