Include name in mention push notification (#2045)
This commit is contained in:
parent
3568fc1c62
commit
fca4d1ff92
@ -163,7 +163,8 @@ export async function nonCriticalSideEffects ({ invoice, id }, { models }) {
|
||||
where: invoice ? { invoiceId: invoice.id } : { id: parseInt(id) },
|
||||
include: {
|
||||
mentions: true,
|
||||
itemReferrers: { include: { refereeItem: true } }
|
||||
itemReferrers: { include: { refereeItem: true } },
|
||||
user: true
|
||||
}
|
||||
})
|
||||
// compare timestamps to only notify if mention or item referral was just created to avoid duplicates on edits
|
||||
|
@ -319,14 +319,14 @@ export const notifyZapped = async ({ models, item }) => {
|
||||
export const notifyMention = async ({ models, userId, item }) => {
|
||||
try {
|
||||
const muted = await isMuted({ models, muterId: userId, mutedId: item.userId })
|
||||
if (!muted) {
|
||||
await sendUserNotification(userId, {
|
||||
title: 'you were mentioned',
|
||||
body: item.text,
|
||||
item,
|
||||
tag: 'MENTION'
|
||||
})
|
||||
}
|
||||
if (muted) return
|
||||
|
||||
await sendUserNotification(userId, {
|
||||
title: `@${item.user.name} mentioned you`,
|
||||
body: item.text,
|
||||
item,
|
||||
tag: 'MENTION'
|
||||
})
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user