Skip to content

Commit

Permalink
include notifications url for merged payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Soxasora committed Jan 6, 2025
1 parent e1e3a24 commit f51869a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sw/eventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit f51869a

Please sign in to comment.