Files
hermes-desktop/packages/client/public/notification-sw.js
T
toor 01d9e301fc
Build / build (push) Canceled after 0s
Playwright / browser (push) Canceled after 0s
initialize Electron desktop app and remove unused files
2026-10-25 01:09:01 +08:00

11 lines
371 B
JavaScript

self.addEventListener('notificationclick', (event) => {
event.notification.close()
event.waitUntil((async () => {
const windows = await clients.matchAll({ type: 'window', includeUncontrolled: true })
for (const client of windows) {
if ('focus' in client) return client.focus()
}
if (clients.openWindow) return clients.openWindow('/')
})())
})