Do not display desktop chat notification when the chat is focused

This commit is contained in:
eugenijm 2020-07-13 15:48:19 +03:00
parent 2c35afeebf
commit 54dea24bb8

View file

@ -2,6 +2,7 @@ import { showDesktopNotification } from '../desktop_notification_utils/desktop_n
export const maybeShowChatNotification = (store, chat) => { export const maybeShowChatNotification = (store, chat) => {
if (!chat.lastMessage) return if (!chat.lastMessage) return
if (store.rootState.chats.currentChatId === chat.id && !document.hidden) return
const opts = { const opts = {
tag: chat.lastMessage.id, tag: chat.lastMessage.id,