mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-14 02:08:50 +02:00
[bug] Address existing data & defaults when migrating from an unauthenticated state (#626)
This commit is contained in:
parent
69fe7b8339
commit
9b0e5ae456
@ -2219,6 +2219,7 @@ export class StateService<TAccount extends Account = Account>
|
||||
await this.storageService.remove(keys.tempAccountSettings);
|
||||
}
|
||||
account.settings.environmentUrls = environmentUrls;
|
||||
Object.assign(account.settings, this.createAccount().settings);
|
||||
await this.storageService.save(
|
||||
account.profile.userId,
|
||||
account,
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user