Змінено директорії
Додано скрипти CRON Поліпшено механізм запису стендів та їх редагування
This commit is contained in:
10
web/sw.js
10
web/sw.js
@@ -1,4 +1,4 @@
|
||||
const STATIC_CACHE_NAME = 'v2.0.2';
|
||||
const STATIC_CACHE_NAME = 'v2.0.13';
|
||||
|
||||
const FILES_TO_CACHE = [
|
||||
'/',
|
||||
@@ -48,6 +48,9 @@ const FILES_TO_CACHE = [
|
||||
"/lib/pages/territory/editor/script.js",
|
||||
"/lib/pages/territory/editor/style.css",
|
||||
|
||||
"/lib/pages/territory/editor/script.js",
|
||||
"/lib/pages/territory/editor/style.css",
|
||||
|
||||
"/lib/pages/territory/card/script.js",
|
||||
"/lib/pages/territory/card/style.css",
|
||||
|
||||
@@ -110,6 +113,9 @@ self.addEventListener("push", event => {
|
||||
let data = {};
|
||||
try { data = event.data.json(); } catch { data = { title: "Уведомлення", body: event.data?.text() }; }
|
||||
|
||||
console.log(data);
|
||||
|
||||
|
||||
const title = data.title || "Уведомлення";
|
||||
const options = {
|
||||
body: data.body || "",
|
||||
@@ -124,7 +130,7 @@ self.addEventListener("push", event => {
|
||||
self.addEventListener("notificationclick", event => {
|
||||
event.notification.close();
|
||||
event.waitUntil(
|
||||
clients.matchAll({ type: "window", includeUncontrolled: true }).then(clientList => {
|
||||
clients.matchAll({ type: "window", includeUncontrolled: true }).then(clientList => {
|
||||
for (const client of clientList) {
|
||||
if (client.url === event.notification.data && "focus" in client) return client.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user