From 39d13d5e4592ad485bce3affaf609dd9367d70cd Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 26 Aug 2015 16:10:44 -0700 Subject: [PATCH] Quiet notifications if the window is open Draw attention to the window instead. // FREEBIE --- js/panel_controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/panel_controller.js b/js/panel_controller.js index aefc3a0a2..4e75d05cd 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -86,11 +86,10 @@ window.notifyConversation = function(message) { var conversationId = message.get('conversationId'); - var windowId = windowMap.windowIdFrom(conversationId); - if (windowId) { + if (inboxOpened) { // already open updateConversation(conversationId); - extension.windows.drawAttention(windowId); + extension.windows.drawAttention(inboxWindowId); } else if (Whisper.Notifications.isEnabled()) { var conversation = getConversation({id: message.get('conversationId')}); var sender = getConversation({id: message.get('source')}); @@ -109,6 +108,7 @@ conversation.fetchMessages(); } else { openConversation(conversationId); + openInbox(); extension.windows.drawAttention(windowId); } };