From ae3c1da114e28a6ec33772ca21f17902217f1799 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 25 Mar 2016 14:40:43 +0100 Subject: [PATCH] Only notify new chats if chat is active. --- app/assets/javascripts/app/controllers/chat.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/chat.coffee b/app/assets/javascripts/app/controllers/chat.coffee index b23fe5163..4081293e9 100644 --- a/app/assets/javascripts/app/controllers/chat.coffee +++ b/app/assets/javascripts/app/controllers/chat.coffee @@ -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