Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Display the new update's version in 'Available Updates'.

Name and description, also.

Fixes #1497
  • Loading branch information...
commit 9777bb42eef4b1135e9858950afff13524b4cc5f 1 parent 660522f
@arantius arantius authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 modules/addons4.js
View
16 modules/addons4.js
@@ -201,7 +201,13 @@ ScriptAddon.prototype._handleRemoteUpdate = function(
try {
if (aAvailable) {
- var scriptInstall = ScriptInstallFactoryByAddon(this);
+ // Purge any possible ScriptInstall cache.
+ if (this.id in ScriptInstallCache) {
+ delete ScriptInstallCache[this.id];
+ }
+ // Then create one with this newly found update info.
+ var scriptInstall = ScriptInstallFactoryByAddon(
+ this, this._script.availableUpdate);
AddonManagerPrivate.callInstallListeners(
'onNewInstall', [], scriptInstall);
tryToCall(aUpdateListener, 'onUpdateAvailable', this, scriptInstall);
@@ -243,15 +249,15 @@ ScriptAddon.prototype.performUninstall = function() {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var ScriptInstallCache = {};
-function ScriptInstallFactoryByAddon(aAddon) {
+function ScriptInstallFactoryByAddon(aAddon, aScriptToInstall) {
if (!(aAddon.id in ScriptInstallCache)) {
- ScriptInstallCache[aAddon.id] = new ScriptInstall(aAddon);
+ ScriptInstallCache[aAddon.id] = new ScriptInstall(aAddon, aScriptToInstall);
}
return ScriptInstallCache[aAddon.id];
}
-function ScriptInstall(aAddon) {
- this._script = aAddon._script;
+function ScriptInstall(aAddon, aScriptToInstall) {
+ this._script = aScriptToInstall || aAddon._script;
this.name = this._script.name;
this.version = this._script.version;
Please sign in to comment.
Something went wrong with that request. Please try again.