Refactor code structure for improved readability and maintainability
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m31s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m31s
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
/* Service Worker for Reward App push notifications */
|
||||
|
||||
/* Activate immediately — no waiting for old tabs to close */
|
||||
self.addEventListener('install', function (event) {
|
||||
event.waitUntil(self.skipWaiting())
|
||||
})
|
||||
|
||||
self.addEventListener('activate', function (event) {
|
||||
event.waitUntil(self.clients.claim())
|
||||
})
|
||||
|
||||
self.addEventListener('push', function (event) {
|
||||
if (!event.data) return
|
||||
|
||||
@@ -13,6 +22,7 @@ self.addEventListener('push', function (event) {
|
||||
const title = payload.title || 'Reward App'
|
||||
const options = {
|
||||
body: payload.body || '',
|
||||
icon: '/icons/icon-192x192.png',
|
||||
data: payload,
|
||||
actions: [
|
||||
{ action: 'approve', title: 'Approve' },
|
||||
|
||||
Reference in New Issue
Block a user