chore: rewrite sw push
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 2m24s

This commit is contained in:
Nathan Lamy 2025-08-21 12:15:31 +02:00
parent 63dbad65ea
commit fbd7138af9

View file

@ -23,14 +23,13 @@ self.addEventListener("notificationclick", function (event) {
const clickedNotification = event.notification;
clickedNotification.close();
if (event.action == "open" && event.data.id) {
if (event.action == "open" && event.data?.id) {
const promiseChain = clients.openWindow(
BASE_URL + "/colles/" + event.data.id
);
event.waitUntil(promiseChain);
return;
} else {
const promiseChain = clients.openWindow(BASE_URL);
event.waitUntil(promiseChain);
}
const promiseChain = clients.openWindow(BASE_URL);
event.waitUntil(promiseChain);
});