From 16e9f03d8f7a06330b0c96a0723cf1bfeb399ffb Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 15 May 2015 13:54:29 -0700 Subject: [PATCH] Check for registration when launched --- js/background.js | 5 ----- js/panel_controller.js | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/background.js b/js/background.js index 7019d549..2f754003 100644 --- a/js/background.js +++ b/js/background.js @@ -20,11 +20,6 @@ storage.onready(function() { var messageReceiver; - if (!storage.get('first_install_ran')) { - storage.put('first_install_ran', 1); - extension.install(); - } - if (textsecure.registration.isDone()) { init(); } diff --git a/js/panel_controller.js b/js/panel_controller.js index 60f920d6..691a24cd 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -139,7 +139,14 @@ }); } }; - extension.onLaunched(openInbox); + + extension.onLaunched(function() { + if (textsecure.registration.isDone()) { + openInbox(); + } else { + extension.install(); + } + }); // make sure windows are cleaned up on close extension.windows.onClosed(function (windowId) {