1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-06 00:03:29 +00:00

Run addAccount storage scaffolding calls through saveAccount (#675)

This commit is contained in:
Addison Beck
2022-02-11 11:12:18 -05:00
committed by GitHub
parent e3b29a40d3
commit cdc6cbaeb3

View File

@@ -2246,11 +2246,7 @@ export class StateService<
account.profile.apiKeyClientId = null;
account.keys.apiKeyClientSecret = null;
}
await this.storageService.save(
account.profile.userId,
account,
await this.defaultOnDiskLocalOptions()
);
await this.saveAccount(account, await this.defaultOnDiskLocalOptions());
}
protected async scaffoldNewAccountMemoryStorage(account: TAccount): Promise<void> {
@@ -2262,11 +2258,7 @@ export class StateService<
storedAccount.settings.environmentUrls = account.settings.environmentUrls;
account.settings = storedAccount.settings;
}
await this.storageService.save(
account.profile.userId,
account,
await this.defaultOnDiskMemoryOptions()
);
await this.saveAccount(account, await this.defaultOnDiskLocalOptions());
}
protected async scaffoldNewAccountSessionStorage(account: TAccount): Promise<void> {
@@ -2278,11 +2270,7 @@ export class StateService<
storedAccount.settings.environmentUrls = account.settings.environmentUrls;
account.settings = storedAccount.settings;
}
await this.storageService.save(
account.profile.userId,
account,
await this.defaultOnDiskOptions()
);
await this.saveAccount(account, await this.defaultOnDiskLocalOptions());
}
//