diff --git a/b2g/components/UpdatePrompt.js b/b2g/components/UpdatePrompt.js index 16cf6a6935d..15716ad47f8 100644 --- a/b2g/components/UpdatePrompt.js +++ b/b2g/components/UpdatePrompt.js @@ -407,6 +407,7 @@ UpdatePrompt.prototype = { // Trigger apps update check and wait for all to be done before // notifying gaia. onUpdateCheckStart: function UP_onUpdateCheckStart() { + log("onUpdateCheckStart (" + this._checkingApps + ")"); // Don't start twice. if (this._checkingApps) { return; @@ -426,8 +427,11 @@ UpdatePrompt.prototype = { this.result.forEach(function updateApp(aApp) { let update = aApp.checkForUpdate(); update.onsuccess = function() { + if (aApp.downloadAvailable) { + appsToUpdate.push(aApp.manifestURL); + } + appsChecked += 1; - appsToUpdate.push(aApp.manifestURL); if (appsChecked == appsCount) { self.appsUpdated(appsToUpdate); } diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm index 769a0d59e94..32cf67d9923 100644 --- a/dom/apps/src/Webapps.jsm +++ b/dom/apps/src/Webapps.jsm @@ -914,8 +914,6 @@ this.DOMApplicationRegistry = { app.progress = 0; app.installState = download.previousState; app.downloading = false; - app.downloadAvailable = false; - app.downloadSize = 0; this._saveApps((function() { this.broadcastMessage("Webapps:PackageEvent", { type: "canceled", @@ -968,6 +966,7 @@ this.DOMApplicationRegistry = { manifestURL: aManifestURL, app: app, manifest: jsonManifest }); + DOMApplicationRegistry._saveApps(); } }).bind(this)); @@ -1869,6 +1868,7 @@ this.DOMApplicationRegistry = { manifestURL: aApp.manifestURL, app: app }); lastProgressTime = now; + self._saveApps(); } }, onStatus: function notifStatus(aRequest, aContext, aStatus, aStatusArg) { },