mirror of
https://github.com/moparisthebest/mail
synced 2024-11-22 17:02:17 -05:00
check for update everytime window open again... not just in background page
This commit is contained in:
parent
4ef1d1134c
commit
a59229364e
@ -1,20 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
// check for update and restart app automatically
|
||||
chrome.runtime.onUpdateAvailable.addListener(function(details) {
|
||||
console.log("Updating to version " + details.version);
|
||||
chrome.runtime.reload();
|
||||
});
|
||||
chrome.runtime.requestUpdateCheck(function(status) {
|
||||
if (status === "update_found") {
|
||||
console.log("Update pending...");
|
||||
} else if (status === "no_update") {
|
||||
console.log("No update found.");
|
||||
} else if (status === "throttled") {
|
||||
console.log("Checking updates too frequently.");
|
||||
}
|
||||
});
|
||||
|
||||
// open chrome app in new window
|
||||
chrome.app.runtime.onLaunched.addListener(function() {
|
||||
chrome.app.window.create('chrome.html', {
|
||||
|
@ -40,6 +40,23 @@ define(function(require) {
|
||||
}
|
||||
};
|
||||
|
||||
self.checkForUpdate = function() {
|
||||
// check for update and restart app automatically
|
||||
chrome.runtime.onUpdateAvailable.addListener(function(details) {
|
||||
console.log("Updating to version " + details.version);
|
||||
chrome.runtime.reload();
|
||||
});
|
||||
chrome.runtime.requestUpdateCheck(function(status) {
|
||||
if (status === "update_found") {
|
||||
console.log("Update pending...");
|
||||
} else if (status === "no_update") {
|
||||
console.log("No update found.");
|
||||
} else if (status === "throttled") {
|
||||
console.log("Checking updates too frequently.");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Request an OAuth token from chrome for gmail users
|
||||
*/
|
||||
|
@ -16,6 +16,9 @@ define(function(require) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check for app update
|
||||
appController.checkForUpdate();
|
||||
// login to imap
|
||||
initializeUser();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user