mirror of
https://github.com/moparisthebest/mail
synced 2024-11-23 01:12:19 -05:00
do silent auto update on each startup
This commit is contained in:
parent
23a53e6a3f
commit
415c0abbff
@ -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") {
|
||||
|
@ -16,6 +16,9 @@ define(function(require) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check for app update
|
||||
appController.checkForUpdate();
|
||||
|
||||
// login to imap
|
||||
initializeUser();
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user