diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-01-16 20:50:17 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-01-16 20:50:17 +0800 |
| commit | c3d14d6134a13736f5920aa5c0a43486a124491b (patch) | |
| tree | b429f61596a8e7cc8a159abd010b8b94819d668c | |
| parent | 59fb64c65ad3367eb424c944ebfb0207b7b4de20 (diff) | |
forgot to push this
| -rw-r--r-- | frontend/sw.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/frontend/sw.js b/frontend/sw.js index b9fa08d..416a2d0 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,23 +1,23 @@ self.addEventListener('push', (e) => { console.log(e.data); - const data = e.data.json(); - console.log(data); - if (data.requireInteraction) { - self.registration.showNotification(data.title, { - body: data.body, + const received_data = e.data.json(); + console.log(received_data); + if (received_data.requireInteraction) { + self.registration.showNotification(received_data.title, { + body: received_data.body, vibrate: [200, 100, 200], - requireInteraction: data.requireInteraction, + requireInteraction: received_data.requireInteraction, actions: [ { title: "I've collected my laundry!", action: "collect", } ], - data: {timerId: data.timerId}, + data: {timerId: received_data.timerId}, }); } else { - self.registration.showNotification(data.title, { - body: data.body, + self.registration.showNotification(received_data.title, { + body: received_data.body, vibrate: [200, 100, 200], }); } |
