1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

[bug] Assign client specific account settings during migration (#653)

* [bug] Assign client specific account settings during migration

* [refactor] Write State type arguements in consistent order

* [style] Ran prettier
This commit is contained in:
Addison Beck
2022-02-03 13:32:42 -05:00
committed by GitHub
parent ca5c6a9c32
commit 067cd1e0e1
5 changed files with 103 additions and 86 deletions

View File

@@ -55,14 +55,14 @@ const partialKeys = {
};
export class StateService<
TAccount extends Account = Account,
TGlobalState extends GlobalState = GlobalState
TGlobalState extends GlobalState = GlobalState,
TAccount extends Account = Account
> implements StateServiceAbstraction<TAccount>
{
accounts = new BehaviorSubject<{ [userId: string]: TAccount }>({});
activeAccount = new BehaviorSubject<string>(null);
protected state: State<TAccount, TGlobalState> = new State<TAccount, TGlobalState>(
protected state: State<TGlobalState, TAccount> = new State<TGlobalState, TAccount>(
this.createGlobals()
);
@@ -73,7 +73,7 @@ export class StateService<
protected secureStorageService: StorageService,
protected logService: LogService,
protected stateMigrationService: StateMigrationService,
protected stateFactory: StateFactory<TAccount, TGlobalState>
protected stateFactory: StateFactory<TGlobalState, TAccount>
) {}
async init(): Promise<void> {
@@ -2233,7 +2233,6 @@ export class StateService<
account.settings = await this.storageService.get<any>(keys.tempAccountSettings);
await this.storageService.remove(keys.tempAccountSettings);
}
Object.assign(account.settings, this.createAccount().settings);
account.settings.environmentUrls = environmentUrls;
await this.storageService.save(
account.profile.userId,