Close stale windows on background refresh

All the old event listeners and in-memory objects have perished with the
old background page. Also reopen the inbox if it was already open.

Fixes #289

// FREEBIE
This commit is contained in:
lilia 2015-07-14 12:33:16 -07:00
parent 815b79dc64
commit 971079980e

View file

@ -22,6 +22,11 @@
});
chrome.alarms.create('awake', {periodInMinutes: 1});
}
var open = false;
chrome.app.window.getAll().forEach(function(appWindow) {
open = true;
appWindow.close();
});
storage.fetch();
storage.onready(function() {
@ -52,6 +57,10 @@
// initialize the socket and start listening for messages
messageReceiver = new textsecure.MessageReceiver(window);
if (open) {
openInbox();
}
}
function onContactReceived(ev) {