Only notify new chats if chat is active.

This commit is contained in:
Martin Edenhofer 2016-03-25 14:40:43 +01:00
parent 1b3190ba6c
commit ae3c1da114

View file

@ -175,12 +175,13 @@ class App.CustomerChat extends App.Controller
if @lastWaitingChatCount isnt counter
# do not play sound on initial load
if counter > 0 && @lastWaitingChatCount isnt undefined
@sounds.chat_new.play()
@notifyDesktop(
title: "#{counter} #{App.i18n.translateInline('Waiting Customers')}",
url: '#customer_chat'
)
if @switch()
if counter > 0 && @lastWaitingChatCount isnt undefined
@sounds.chat_new.play()
@notifyDesktop(
title: "#{counter} #{App.i18n.translateInline('Waiting Customers')}",
url: '#customer_chat'
)
@lastWaitingChatCount = counter
# collect chat window messages