chore: rewrite sw push
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 2m24s
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 2m24s
This commit is contained in:
parent
63dbad65ea
commit
fbd7138af9
1 changed files with 4 additions and 5 deletions
|
|
@ -23,14 +23,13 @@ self.addEventListener("notificationclick", function (event) {
|
||||||
const clickedNotification = event.notification;
|
const clickedNotification = event.notification;
|
||||||
clickedNotification.close();
|
clickedNotification.close();
|
||||||
|
|
||||||
if (event.action == "open" && event.data.id) {
|
if (event.action == "open" && event.data?.id) {
|
||||||
const promiseChain = clients.openWindow(
|
const promiseChain = clients.openWindow(
|
||||||
BASE_URL + "/colles/" + event.data.id
|
BASE_URL + "/colles/" + event.data.id
|
||||||
);
|
);
|
||||||
event.waitUntil(promiseChain);
|
event.waitUntil(promiseChain);
|
||||||
return;
|
} else {
|
||||||
|
const promiseChain = clients.openWindow(BASE_URL);
|
||||||
|
event.waitUntil(promiseChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
const promiseChain = clients.openWindow(BASE_URL);
|
|
||||||
event.waitUntil(promiseChain);
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue