@@ -2,7 +2,7 @@ import ServiceWorkerStorage from 'serviceworker-storage'
2
2
import { numWithUnits } from '@/lib/format'
3
3
import { CLEAR_NOTIFICATIONS , clearAppBadge , setAppBadge } from '@/lib/badge'
4
4
import { ACTION_PORT , DELETE_SUBSCRIPTION , MESSAGE_PORT , STORE_OS , STORE_SUBSCRIPTION , SYNC_SUBSCRIPTION } from '@/components/serviceworker'
5
- // import { getLogger } from '@/lib/logger'
5
+ import { getLogger } from '@/lib/logger'
6
6
7
7
// we store existing push subscriptions to keep them in sync with server
8
8
const storage = new ServiceWorkerStorage ( 'sw:storage' , 1 )
@@ -97,6 +97,7 @@ const mergeNotification = (event, sw, payload, currentNotifications, tag, nid) =
97
97
// currentNotifications.reduce causes iOS to sum n notifications + initialAmount which is already n notifications
98
98
const mergedPayload = {
99
99
...incomingData ,
100
+ url : '/notifications' , // when merged we should always go to the notifications page
100
101
amount : initialAmount + 1 ,
101
102
sats : initialSats + incomingData . sats
102
103
}
@@ -131,7 +132,7 @@ const mergeNotification = (event, sw, payload, currentNotifications, tag, nid) =
131
132
}
132
133
// logger.info(`[sw:push] ${nid} - calculated title: ${title}`)
133
134
134
- const options = { icon : payload . options ?. icon , tag, data : { url : '/notifications' , ...mergedPayload } }
135
+ const options = { icon : payload . options ?. icon , tag, data : { ...mergedPayload } }
135
136
// logger.info(`[sw:push] ${nid} - show notification with title "${title}"`)
136
137
return { title, options } // send the new, merged, payload
137
138
}
0 commit comments