From 5fd85e2f3ec0cab517a397c1d24a08dec1737591 Mon Sep 17 00:00:00 2001 From: Thomas Wilburn Date: Mon, 16 Dec 2013 10:44:11 -0800 Subject: [PATCH] Fix for updates reloading too fast, thanks Chrome team! --- js/main.js | 16 +++++++++------- manifest.json | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/js/main.js b/js/main.js index 85ceb64..39772e5 100644 --- a/js/main.js +++ b/js/main.js @@ -38,13 +38,15 @@ require([ var checkUpdates = function(isManual) { chrome.runtime.requestUpdateCheck(function(status, details) { if (status == "update_available") { - chrome.notifications.create(updateID, { - type: "basic", - iconUrl: "icon-128.png", - title: "Caret: Update Available", - message: "An update to Caret version " + details.version + " is available. Would you like to update and restart now?", - buttons: [ { title: "Yes, update and restart" }, { title: "No thanks" }] - }, function(id) { updateID = id }); + chrome.runtime.onUpdateAvailable.addListener(function() { + chrome.notifications.create(updateID, { + type: "basic", + iconUrl: "icon-128.png", + title: "Caret: Update Available", + message: "An update to Caret version " + details.version + " is available. Would you like to update and restart now?", + buttons: [ { title: "Yes, update and restart" }, { title: "No thanks" }] + }, function(id) { updateID = id }); + }); } }); }; diff --git a/manifest.json b/manifest.json index 166dda8..5494d32 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Caret", "description": "Professional text editing for Chrome and Chrome OS", - "version": "1.2.32", + "version": "1.2.35", "manifest_version": 2, "icons": { "128": "icon-128.png"