diff --git a/sw/eventListener.js b/sw/eventListener.js index 4f63641f2..3d65ef20e 100644 --- a/sw/eventListener.js +++ b/sw/eventListener.js @@ -2,7 +2,7 @@ import ServiceWorkerStorage from 'serviceworker-storage' import { numWithUnits } from '@/lib/format' import { CLEAR_NOTIFICATIONS, clearAppBadge, setAppBadge } from '@/lib/badge' import { ACTION_PORT, DELETE_SUBSCRIPTION, MESSAGE_PORT, STORE_OS, STORE_SUBSCRIPTION, SYNC_SUBSCRIPTION } from '@/components/serviceworker' -// import { getLogger } from '@/lib/logger' +import { getLogger } from '@/lib/logger' // we store existing push subscriptions to keep them in sync with server const storage = new ServiceWorkerStorage('sw:storage', 1) @@ -97,6 +97,7 @@ const mergeNotification = (event, sw, payload, currentNotifications, tag, nid) = // currentNotifications.reduce causes iOS to sum n notifications + initialAmount which is already n notifications const mergedPayload = { ...incomingData, + url: '/notifications', // when merged we should always go to the notifications page amount: initialAmount + 1, sats: initialSats + incomingData.sats } @@ -131,7 +132,7 @@ const mergeNotification = (event, sw, payload, currentNotifications, tag, nid) = } // logger.info(`[sw:push] ${nid} - calculated title: ${title}`) - const options = { icon: payload.options?.icon, tag, data: { url: '/notifications', ...mergedPayload } } + const options = { icon: payload.options?.icon, tag, data: { ...mergedPayload } } // logger.info(`[sw:push] ${nid} - show notification with title "${title}"`) return { title, options } // send the new, merged, payload }