clear localStorage for CM themes on extension update

This commit is contained in:
tophf 2018-03-03 23:45:14 +03:00
parent f9789e327b
commit 850b7dc635

View File

@ -98,11 +98,13 @@ prefs.subscribe(['iconset'], () =>
{
const onInstall = ({reason}) => {
chrome.runtime.onInstalled.removeListener(onInstall);
// reset L10N cache on update
if (reason === 'update') {
// translations may change
localStorage.L10N = JSON.stringify({
browserUIlanguage: chrome.i18n.getUILanguage(),
});
// themes may change
delete localStorage.codeMirrorThemes;
}
};
// bind for 60 seconds max and auto-unbind if it's a normal run