fix chrome "this site has been updated in the background" message

inbox2
Thibault Duplessis 2020-01-26 12:09:20 -06:00
parent 858e72e9e9
commit 8b5ca6a0ca
1 changed files with 2 additions and 2 deletions

View File

@ -7,14 +7,14 @@ function assetUrl(path: string): string {
self.addEventListener('push', event => {
const data = event.data!.json();
return self.registration.showNotification(data.title, {
return event.waitUntil(self.registration.showNotification(data.title, {
badge: assetUrl('logo/lichess-mono-128.png'),
icon: assetUrl('logo/lichess-favicon-192.png'),
body: data.body,
tag: data.tag,
data: data.payload,
requireInteraction: true,
});
}));
});
async function handleNotificationClick(event: NotificationEvent) {