1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +01:00

Save usesKeyConnector using defaultOnDiskOptions (#617)

This commit is contained in:
Thomas Rittson 2022-01-20 19:32:44 +10:00 committed by GitHub
parent 9737c829f3
commit 11e7133aef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1993,16 +1993,20 @@ export class StateService<TAccount extends Account = Account>
} }
async getUsesKeyConnector(options?: StorageOptions): Promise<boolean> { async getUsesKeyConnector(options?: StorageOptions): Promise<boolean> {
return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))) return (
?.profile?.usesKeyConnector; await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions()))
)?.profile?.usesKeyConnector;
} }
async setUsesKeyConnector(value: boolean, options?: StorageOptions): Promise<void> { async setUsesKeyConnector(value: boolean, options?: StorageOptions): Promise<void> {
const account = await this.getAccount( const account = await this.getAccount(
this.reconcileOptions(options, this.defaultInMemoryOptions) this.reconcileOptions(options, await this.defaultOnDiskOptions())
); );
account.profile.usesKeyConnector = value; account.profile.usesKeyConnector = value;
await this.saveAccount(account, this.reconcileOptions(options, this.defaultInMemoryOptions)); await this.saveAccount(
account,
this.reconcileOptions(options, await this.defaultOnDiskOptions())
);
} }
async getVaultTimeout(options?: StorageOptions): Promise<number> { async getVaultTimeout(options?: StorageOptions): Promise<number> {