aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-06 23:33:33 -0800
committerAdam Soltys <[email protected]>2026-03-06 23:33:33 -0800
commit2c0782226f9841b3a4ce91bec95824f68a8c74ec (patch)
tree2f6408548afec970f5b906342e54521e51f5f960
parentfcd2e1bd87eed2ddb267f37d28db84e32b7d7b61 (diff)
downloadcoinos-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.js16
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));
});