diff --git a/src/script/optionPage.ts b/src/script/optionPage.ts index 1b6ce84f..aabdd8fe 100644 --- a/src/script/optionPage.ts +++ b/src/script/optionPage.ts @@ -654,7 +654,7 @@ export default class OptionPage { async convertStorageLocation(evt: Event = null, silent = false) { const configSyncLargeKeys = document.getElementById('configSyncLargeKeys') as HTMLInputElement; this.cfg.syncLargeKeys = configSyncLargeKeys.checked; - const keys = this.Class.Config._localConfigKeys; + const keys = this.Class.Config._largeKeys.concat(['syncLargeKeys']); try { await this.cfg.save(keys); diff --git a/src/script/webConfig.ts b/src/script/webConfig.ts index bf0fc44e..fc2daa6d 100644 --- a/src/script/webConfig.ts +++ b/src/script/webConfig.ts @@ -41,8 +41,7 @@ export default class WebConfig extends Config { static _defaults = this.initializeDefaults({}, this._configDefaults, this._webDefaults) as WebConfig; static _persistableKeys = Object.keys(this._defaults); // Make sure _defaults has already been assigned before this - static readonly _localConfigKeys = ['domains', 'syncLargeKeys', 'words']; - static readonly _localOnlyKeys = ['background', 'stats']; + static readonly _localOnlyKeys = ['background', 'stats', 'syncLargeKeys']; static readonly _maxSplitKeys = 64; static readonly _largeKeys = ['domains', 'words']; @@ -402,7 +401,7 @@ export default class WebConfig extends Config { async resetPreserveStats() { try { await this.Class.resetSyncStorage(); - await this.Class.removeLocalStorage(this.Class._localConfigKeys); + await this.Class.removeLocalStorage(removeFromArray(this.Class._localOnlyKeys, 'stats')); } catch (err) { logger.error('Failed to clear storage.', err); throw new Error(`Failed to clear storage. ${err.message}`);