Skip to content

Commit

Permalink
fix chrome "this site has been updated in the background" message
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 26, 2020
1 parent 858e72e commit 8b5ca6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/serviceWorker/src/main.ts
Expand Up @@ -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) {
Expand Down

0 comments on commit 8b5ca6a

Please sign in to comment.