From 415c0abbff49cacd7112e82bfc26767d739d1022 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sat, 9 Nov 2013 00:30:45 +0100 Subject: [PATCH] do silent auto update on each startup --- src/js/app-controller.js | 10 ++++------ src/js/controller/login.js | 3 +++ src/js/controller/navigation.js | 15 --------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/js/app-controller.js b/src/js/app-controller.js index 15c95e8..c0ad086 100644 --- a/src/js/app-controller.js +++ b/src/js/app-controller.js @@ -40,17 +40,15 @@ define(function(require) { } }; - self.checkForUpdate = function(callback) { + self.checkForUpdate = function() { if (!chrome || !chrome.runtime || !chrome.runtime.onUpdateAvailable) { return; } - // check for update and restart on confirmation + // check for update and restart chrome.runtime.onUpdateAvailable.addListener(function(details) { - callback(function() { - console.log("Updating to version " + details.version); - chrome.runtime.reload(); - }); + console.log("Updating to version " + details.version); + chrome.runtime.reload(); }); chrome.runtime.requestUpdateCheck(function(status) { if (status === "update_found") { diff --git a/src/js/controller/login.js b/src/js/controller/login.js index aa5e386..483e35c 100644 --- a/src/js/controller/login.js +++ b/src/js/controller/login.js @@ -16,6 +16,9 @@ define(function(require) { return; } + // check for app update + appController.checkForUpdate(); + // login to imap initializeUser(); }); diff --git a/src/js/controller/navigation.js b/src/js/controller/navigation.js index e8eecba..2edeb7d 100644 --- a/src/js/controller/navigation.js +++ b/src/js/controller/navigation.js @@ -125,21 +125,6 @@ define(function(require) { // Start // - function onUpdateAvailable(doUpdate) { - $scope.state.dialog = { - open: true, - title: 'Update available', - message: 'Would you like to update the application now?', - callback: function(confirm) { - if (confirm) { - doUpdate(); - } - } - }; - } - // check for app update - appController.checkForUpdate(onUpdateAvailable); - // init folders initFolders(function(folders) { $scope.folders = folders;