Remove notification after click
This commit is contained in:
parent
67423699b6
commit
ba3c406bc7
|
@ -16,7 +16,10 @@ self.addEventListener('push', function (event) {
|
||||||
self.addEventListener('notificationclick', async event => {
|
self.addEventListener('notificationclick', async event => {
|
||||||
if (event.notification.tag === 'inbox') {
|
if (event.notification.tag === 'inbox') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return clients.openWindow("/inbox", "_blank");
|
return clients.openWindow("/inbox", "_blank").then(result => {
|
||||||
|
event.notification.close();
|
||||||
|
return result;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
console.warn(`Unhandled notification tag: ${event.notification.tag}`);
|
console.warn(`Unhandled notification tag: ${event.notification.tag}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue