From a1ed58f6e6fe593e536d6163a5f8ceaf65c0154a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 16 Nov 2015 11:32:26 +0100 Subject: [PATCH] Do not play sounds on initial load. --- app/assets/javascripts/app/controllers/chat.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/chat.coffee b/app/assets/javascripts/app/controllers/chat.coffee index 7bd2133c1..80815b094 100644 --- a/app/assets/javascripts/app/controllers/chat.coffee +++ b/app/assets/javascripts/app/controllers/chat.coffee @@ -81,7 +81,10 @@ class App.CustomerChat extends App.Controller # play on changes if @lastWaitingChatCount isnt counter - @sounds.chat_new.play() + + # do not play sound on initial load + if counter > 0 && @lastWaitingChatCount isnt undefined + @sounds.chat_new.play() @lastWaitingChatCount = counter # collect chat window messages