Skip to content

Commit

Permalink
feat: migration from v1.0 to v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
prinsss committed Apr 13, 2024
1 parent 8014b9e commit db5c124
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/storage/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ export class AppOptionsManager {
...safeJSONParse(localStorage.getItem(LOCAL_STORAGE_KEY) || '{}'),
};

const oldVersion = this.appOptions.version ?? '';
const newVersion = DEFAULT_APP_OPTIONS.version ?? '';

// Migrate from v1.0 to v1.1.
if (newVersion.startsWith('1.1') && oldVersion.startsWith('1.0')) {
this.appOptions.disabledExtensions = [
...(this.appOptions.disabledExtensions ?? []),
'HomeTimelineModule',
'ListTimelineModule',
];
logger.info(`App options migrated from v${oldVersion} to v${newVersion}`);
setTimeout(() => this.saveAppOptions(), 0);
}

this.previous = { ...this.appOptions };
logger.info('App options loaded', this.appOptions);
this.signal.value++;
Expand Down

0 comments on commit db5c124

Please sign in to comment.