diff options
| author | Adam Soltys <[email protected]> | 2026-03-06 23:33:33 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-06 23:33:33 -0800 |
| commit | 2c0782226f9841b3a4ce91bec95824f68a8c74ec (patch) | |
| tree | 2f6408548afec970f5b906342e54521e51f5f960 | |
| parent | fcd2e1bd87eed2ddb267f37d28db84e32b7d7b61 (diff) | |
| download | coinos-ui-2c0782226f9841b3a4ce91bec95824f68a8c74ec.tar.gz coinos-ui-2c0782226f9841b3a4ce91bec95824f68a8c74ec.zip | |
simplify notification click to just openWindow
Co-Authored-By: Claude Opus 4.6 <[email protected]>
| -rw-r--r-- | src/service-worker.js | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/service-worker.js b/src/service-worker.js index d314f980..b4c576ba 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -130,19 +130,5 @@ self.addEventListener("notificationclick", (event) => { const path = event.notification.data.url || "/"; const target = new URL(path, self.location.origin).href; - event.waitUntil( - clients.matchAll({ type: "window" }).then((clientList) => { - for (const client of clientList) { - if ("navigate" in client) { - return client.navigate(target).then(() => client.focus()); - } - if ("focus" in client) { - return client.focus(); - } - } - if (clients.openWindow) { - return clients.openWindow(target); - } - }), - ); + event.waitUntil(clients.openWindow(target)); }); |
