From c3d14d6134a13736f5920aa5c0a43486a124491b Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Fri, 16 Jan 2026 20:50:17 +0800 Subject: forgot to push this --- frontend/sw.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'frontend') 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], }); } -- cgit v1.2.3