1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 02:23:44 +00:00
Files
browser/apps/web/src/app/core/state-migration.service.ts
2022-07-26 19:34:45 +02:00

14 lines
653 B
TypeScript

import { StateMigrationService as BaseStateMigrationService } from "@bitwarden/common/services/stateMigration.service";
import { Account } from "./state/account";
import { GlobalState } from "./state/global-state";
export class StateMigrationService extends BaseStateMigrationService<GlobalState, Account> {
protected async migrationStateFrom1To2(): Promise<void> {
await super.migrateStateFrom1To2();
const globals = (await this.get<GlobalState>("global")) ?? this.stateFactory.createGlobal(null);
globals.rememberEmail = (await this.get<boolean>("rememberEmail")) ?? globals.rememberEmail;
await this.set("global", globals);
}
}