Only reset prefs when installing or overwriting (downgrade).
authorEdward Lee <edilee@mozilla.com>
Mon, 20 Dec 2010 15:21:19 -0800
changeset 24 b32ec8ed88b8aa4fb6abc4e7ae7952b4becad6c5
parent 23 ab383cd2d6d9551a15c5ec8c5a048c7a68103704
child 25 b812d736884e4aaa18e8a8d38b79ef07af173fd2
push id25
push useredward.lee@engineering.uiuc.edu
push dateMon, 20 Dec 2010 23:21:26 +0000
Only reset prefs when installing or overwriting (downgrade).
bootstrap.js
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -455,16 +455,20 @@ function shutdown(data, reason) {
 
   unloaders.forEach(function(unload) unload());
 }
 
 /**
  * Handle the add-on being installed
  */
 function install(data, reason) {
+  // Don't bother resetting prefs when upgrading
+  if (reason == ADDON_UPGRADE)
+    return;
+
   // Clear out any old preferences/state when installed
   Cu.import("resource://services-sync/ext/Preferences.js");
   prefs.resetBranch("");
 }
 
 /**
  * Handle the add-on being uninstalled
  */