fix chrome "this site has been updated in the background" message
This commit is contained in:
parent
858e72e9e9
commit
8b5ca6a0ca
|
@ -7,14 +7,14 @@ function assetUrl(path: string): string {
|
||||||
|
|
||||||
self.addEventListener('push', event => {
|
self.addEventListener('push', event => {
|
||||||
const data = event.data!.json();
|
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'),
|
badge: assetUrl('logo/lichess-mono-128.png'),
|
||||||
icon: assetUrl('logo/lichess-favicon-192.png'),
|
icon: assetUrl('logo/lichess-favicon-192.png'),
|
||||||
body: data.body,
|
body: data.body,
|
||||||
tag: data.tag,
|
tag: data.tag,
|
||||||
data: data.payload,
|
data: data.payload,
|
||||||
requireInteraction: true,
|
requireInteraction: true,
|
||||||
});
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
async function handleNotificationClick(event: NotificationEvent) {
|
async function handleNotificationClick(event: NotificationEvent) {
|
||||||
|
|
Loading…
Reference in a new issue