feat: Skips notifications for messages from history (the messages on join).

This commit is contained in:
Дамян Минков 2021-12-22 11:06:33 -06:00
parent 1c4283eeca
commit 8d62e010e0
1 changed files with 4 additions and 1 deletions

View File

@ -320,7 +320,10 @@ function _handleReceivedMessage({ dispatch, getState },
const hasRead = participant.local || isChatOpen;
const timestampToDate = timestamp ? new Date(timestamp) : new Date();
const millisecondsTimestamp = timestampToDate.getTime();
const shouldShowNotification = userSelectedNotifications['notify.chatMessages'] && !hasRead && !isReaction;
// skip message notifications on join (the messages having timestamp - coming from the history)
const shouldShowNotification = userSelectedNotifications['notify.chatMessages']
&& !hasRead && !isReaction && !timestamp;
dispatch(addMessage({
displayName,