From 9fcd423e545313b8c03e06f36ca0324a39a599be Mon Sep 17 00:00:00 2001 From: lilia Date: Sat, 7 Nov 2015 14:34:32 -0800 Subject: [PATCH] Clean up references to appWindow Don't resummon the window when you have a reference to it already. // 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 6c4e925a6..3e58bccc8 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -17,6 +17,7 @@ } }; + window.isFocused = function() { return inboxFocused; }; @@ -47,10 +48,10 @@ minWidth: 600, minHeight: 360 }, function (windowInfo) { - inboxWindowId = windowInfo.id; appWindow = windowInfo; + inboxWindowId = appWindow.id; - windowInfo.onClosed.addListener(function () { + appWindow.onClosed.addListener(function () { inboxOpened = false; appWindow = null; }); @@ -81,7 +82,6 @@ var open; window.openConversation = function(conversation) { if (inboxOpened === true) { - var appWindow = chrome.app.window.get(inboxWindowId); appWindow.contentWindow.openConversation(conversation); } else { open = conversation;