fix version change handling

This commit is contained in:
foudfou 2012-01-19 00:13:40 +01:00
parent 9d2c74ce13
commit d0b9d9e45f
1 changed files with 9 additions and 4 deletions

View File

@ -81,6 +81,12 @@ firetray.VersionChange = {
ERROR("unsupported application");
},
initPrefs: function(version) {
firetray.Utils.prefService.setBoolPref("firstrun", false);
firetray.Utils.prefService.setCharPref("installedVersion", version);
this.openTab();
},
onVersionChange: function(addon) {
LOG("VERSION: "+addon.version);
@ -88,10 +94,8 @@ firetray.VersionChange = {
var firstrun = firetray.Utils.prefService.getBoolPref("firstrun");
if (firstrun) {
firetray.Utils.prefService.setBoolPref("firstrun", false);
firetray.Utils.prefService.setCharPref("installedVersion", curVersion);
WARN("FIRST RUN");
this.openTab();
this.initPrefs(curVersion);
} else {
try {
@ -103,9 +107,10 @@ firetray.VersionChange = {
WARN("UPGRADE");
this.openTab();
}
} catch (ex) {
WARN("REINSTALL");
this.openTab();
this.initPrefs(curVersion);
}
}
}