Fix push notification counting on iOS devices (#739)
Co-authored-by: ekzyis <ek@stacker.news>
This commit is contained in:
parent
9a9e81b109
commit
df1edd5b79
|
@ -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
|
// tags that need to know the sum of sats of notifications with same tag for merging
|
||||||
const SUM_SATS_TAGS = ['DEPOSIT']
|
const SUM_SATS_TAGS = ['DEPOSIT']
|
||||||
// this should reflect the amount of notifications that were already merged before
|
// 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}`)
|
log(`[sw:push] ${nid} - initial amount: ${initialAmount}`)
|
||||||
const mergedPayload = currentNotifications.reduce((acc, { data }) => {
|
const mergedPayload = currentNotifications.reduce((acc, { data }) => {
|
||||||
let newAmount, newSats
|
let newAmount, newSats
|
||||||
|
|
Loading…
Reference in New Issue