Добавить деплой без clean/тестов и доработки PWA/сессии в UI

This commit is contained in:
AidarKC
2026-04-20 20:33:20 +03:00
parent bec1d08757
commit 2d48ae7a16
8 changed files with 404 additions and 4 deletions
+22
View File
@@ -53,3 +53,25 @@ self.addEventListener('push', (event) => {
}),
]));
});
self.addEventListener('notificationclick', (event) => {
event.notification?.close();
event.waitUntil((async () => {
const allClients = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });
const existing = allClients.find((client) => {
try {
return client.url.includes('/index.html') || client.url.endsWith('/');
} catch {
return false;
}
});
if (existing) {
await existing.focus();
return;
}
await self.clients.openWindow('./index.html');
})());
});