diff --git a/apps/pwa/src/sw.ts b/apps/pwa/src/sw.ts index 1bbab90..7820f1e 100644 --- a/apps/pwa/src/sw.ts +++ b/apps/pwa/src/sw.ts @@ -171,7 +171,16 @@ self.addEventListener('notificationclick', (event: NotificationEvent) => { // from the current window location (query string with event uid / date). for (const client of clientList) { if ('focus' in client) { - return client.focus().then(() => client.navigate(url)); + return client + .focus() + .then(() => client.navigate(url)) + .then((navigated) => { + if (navigated === null && self.clients.openWindow) + return self.clients.openWindow(url); + }) + .catch(() => { + if (self.clients.openWindow) return self.clients.openWindow(url); + }); } } // No existing window — open a new one at the deep-link URL