Resetting the settings had undesired side effects

This commit is contained in:
kkapsner 2019-12-02 19:13:38 +01:00
parent c62ddcc33f
commit 5020e0b070
3 changed files with 16 additions and 13 deletions

View File

@ -20,7 +20,7 @@
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
"": function(oldStorage){ "": function(oldStorage){
return { return {
storageVersion: 0.5 storageVersion: 0.6
}; };
}, },
0.1: function(oldStorage){ 0.1: function(oldStorage){

View File

@ -141,21 +141,23 @@
alert(error); alert(error);
}); });
}, },
resetSettings: function(){ resetSettings: async function(){
modal.confirm( try {
extension.getTranslation("resetSettings_confirm"), const clear = await modal.confirm(
{ extension.getTranslation("resetSettings_confirm"),
node: this, {
selector: ".settingRow .content" node: this,
} selector: ".settingRow .content"
).then(function(clear){ }
);
if (clear){ if (clear){
browser.storage.local.clear(); await browser.storage.local.clear();
await browser.storage.local.set({storageVersion: settings.storageVersion});
} }
return; }
}).catch(function(error){ catch (error){
logging.warning("Unable to reset settings:", error); logging.warning("Unable to reset settings:", error);
}); }
} }
}; };

View File

@ -10,6 +10,7 @@ Version 0.5.15:
- background color of the textarea in the settings export was not readable in the dark theme when the value was invalid - background color of the textarea in the settings export was not readable in the dark theme when the value was invalid
- settings sanitation: added missing APIs - settings sanitation: added missing APIs
- navigator.oscpu and navigator.buildID are undefined in non Gecko browsers - navigator.oscpu and navigator.buildID are undefined in non Gecko browsers
- resetting the settings had undesired side effects
known issues: known issues:
- if a data URL is blocked the page action button does not appear - if a data URL is blocked the page action button does not appear