diff --git a/public/service_worker.js b/public/service_worker.js index 383b3d0a..f42dd8ef 100644 --- a/public/service_worker.js +++ b/public/service_worker.js @@ -16,7 +16,10 @@ self.addEventListener('push', function (event) { self.addEventListener('notificationclick', async event => { if (event.notification.tag === 'inbox') { event.preventDefault(); - return clients.openWindow("/inbox", "_blank"); + return clients.openWindow("/inbox", "_blank").then(result => { + event.notification.close(); + return result; + }); } else { console.warn(`Unhandled notification tag: ${event.notification.tag}`); }