Fix push notification counting on iOS devices (#739)

Co-authored-by: ekzyis <ek@stacker.news>
This commit is contained in:
ekzyis 2024-01-10 16:25:30 +01:00 committed by GitHub
parent 9a9e81b109
commit df1edd5b79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -117,7 +117,8 @@ const mergeAndShowNotification = async (sw, payload, currentNotifications, tag,
// tags that need to know the sum of sats of notifications with same tag for merging
const SUM_SATS_TAGS = ['DEPOSIT']
// this should reflect the amount of notifications that were already merged before
const initialAmount = currentNotifications[0].data?.amount || 1
let initialAmount = currentNotifications[0]?.data?.amount || 1
if (iOS()) initialAmount = 1
log(`[sw:push] ${nid} - initial amount: ${initialAmount}`)
const mergedPayload = currentNotifications.reduce((acc, { data }) => {
let newAmount, newSats