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

This commit is contained in:
2026-04-16 16:49:54 -04:00
parent 308bf0cc72
commit 43d647a712
7 changed files with 78 additions and 51 deletions

View File

@@ -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' },