1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

[bug] Address existing data & defaults when migrating from an unauthenticated state (#626)

This commit is contained in:
Addison Beck
2022-01-21 12:41:15 -05:00
committed by GitHub
parent 69fe7b8339
commit 9b0e5ae456
2 changed files with 7 additions and 0 deletions

View File

@@ -193,6 +193,12 @@ export class StateMigrationService {
alwaysShowDock: await this.get<boolean>(v1Keys.alwaysShowDock),
};
// Some processes, like biometrics, may have already defined a value before migrations are run
const existingGlobals = await this.get<GlobalState>(keys.global);
if (existingGlobals != null) {
Object.assign(globals, existingGlobals);
}
const userId =
(await this.get<string>(v1Keys.userId)) ?? (await this.get<string>(v1Keys.entityId));