Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let notifyUser = null
if (snapValues.authorUid !== receiverUid) {
const payload = {
notification: {
title: `${snapValues.authorName} `,
body: lastMessage,
icon: snapValues.authorPhotoUrl
? snapValues.authorPhotoUrl
: '/apple-touch-icon.png',
click_action: `https://www.react-most-wanted.com/chats/edit/${senderUid}`,
tag: `chat`,
},
}
notifyUser = notifications.notifyUser(receiverUid, payload).then(() => {
return senderChatMessageRef
.update({
isReceived: context.timestamp,
})
.then(() => {
return senderChatRef.update({
isReceived: context.timestamp,
})
})
})
}
return Promise.all([
udateReceiverChatMessage,
udateSenderChat,
udateReceiverChat,