diff --git a/lib/webPush.js b/lib/webPush.js index 3b7b41c7..3140ac0c 100644 --- a/lib/webPush.js +++ b/lib/webPush.js @@ -308,7 +308,7 @@ export async function notifyEarner (userId, earnings) { export async function notifyDeposit (userId, invoice) { try { await sendUserNotification(userId, { - title: `${numWithUnits(msatsToSats(invoice.received_mtokens), { abbreviate: false })} were deposited in your account`, + title: `${numWithUnits(msatsToSats(invoice.received_mtokens), { abbreviate: false, unitSingular: 'sat was', unitPlural: 'sats were' })} deposited in your account`, body: invoice.comment || undefined, tag: 'DEPOSIT', data: { sats: msatsToSats(invoice.received_mtokens) } @@ -321,7 +321,7 @@ export async function notifyDeposit (userId, invoice) { export async function notifyWithdrawal (userId, wdrwl) { try { await sendUserNotification(userId, { - title: `${numWithUnits(msatsToSats(wdrwl.payment.mtokens), { abbreviate: false })} were withdrawn from your account`, + title: `${numWithUnits(msatsToSats(wdrwl.payment.mtokens), { abbreviate: false, unitSingular: 'sat was', unitPlural: 'sats were' })} withdrawn from your account`, tag: 'WITHDRAWAL', data: { sats: msatsToSats(wdrwl.payment.mtokens) } }) diff --git a/sw/eventListener.js b/sw/eventListener.js index 576b9145..36961920 100644 --- a/sw/eventListener.js +++ b/sw/eventListener.js @@ -154,9 +154,9 @@ const mergeAndShowNotification = async (sw, payload, currentNotifications, tag, } } else if (SUM_SATS_TAGS.includes(compareTag)) { if (compareTag === 'DEPOSIT') { - title = `${numWithUnits(sats, { abbreviate: false })} were deposited in your account` + title = `${numWithUnits(sats, { abbreviate: false, unitSingular: 'sat was', unitPlural: 'sats were' })} deposited in your account` } else if (compareTag === 'WITHDRAWAL') { - title = `${numWithUnits(sats, { abbreviate: false })} were withdrawn from your account` + title = `${numWithUnits(sats, { abbreviate: false, unitSingular: 'sat was', unitPlural: 'sats were' })} withdrawn from your account` } } log(`[sw:push] ${nid} - calculated title: ${title}`)