Only notify new chats if chat is active.
This commit is contained in:
parent
1b3190ba6c
commit
ae3c1da114
1 changed files with 7 additions and 6 deletions
|
@ -175,12 +175,13 @@ class App.CustomerChat extends App.Controller
|
||||||
if @lastWaitingChatCount isnt counter
|
if @lastWaitingChatCount isnt counter
|
||||||
|
|
||||||
# do not play sound on initial load
|
# do not play sound on initial load
|
||||||
if counter > 0 && @lastWaitingChatCount isnt undefined
|
if @switch()
|
||||||
@sounds.chat_new.play()
|
if counter > 0 && @lastWaitingChatCount isnt undefined
|
||||||
@notifyDesktop(
|
@sounds.chat_new.play()
|
||||||
title: "#{counter} #{App.i18n.translateInline('Waiting Customers')}",
|
@notifyDesktop(
|
||||||
url: '#customer_chat'
|
title: "#{counter} #{App.i18n.translateInline('Waiting Customers')}",
|
||||||
)
|
url: '#customer_chat'
|
||||||
|
)
|
||||||
@lastWaitingChatCount = counter
|
@lastWaitingChatCount = counter
|
||||||
|
|
||||||
# collect chat window messages
|
# collect chat window messages
|
||||||
|
|
Loading…
Reference in a new issue