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

[bug] Move enableBrowserIntegration to global state (#630)

This commit is contained in:
Addison Beck
2022-01-24 10:47:41 -05:00
committed by GitHub
parent 4436e5fb60
commit e5cc3de46d
4 changed files with 20 additions and 22 deletions

View File

@@ -988,26 +988,26 @@ export class StateService<TAccount extends Account = Account>
async getEnableBrowserIntegration(options?: StorageOptions): Promise<boolean> {
return (
(await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())))
?.settings?.enableBrowserIntegration ?? false
(await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskOptions())))
?.enableBrowserIntegration ?? false
);
}
async setEnableBrowserIntegration(value: boolean, options?: StorageOptions): Promise<void> {
const account = await this.getAccount(
const globals = await this.getGlobals(
this.reconcileOptions(options, await this.defaultOnDiskOptions())
);
account.settings.enableBrowserIntegration = value;
await this.saveAccount(
account,
globals.enableBrowserIntegration = value;
await this.saveGlobals(
globals,
this.reconcileOptions(options, await this.defaultOnDiskOptions())
);
}
async getEnableBrowserIntegrationFingerprint(options?: StorageOptions): Promise<boolean> {
return (
(await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())))
?.settings?.enableBrowserIntegrationFingerprint ?? false
(await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskOptions())))
?.enableBrowserIntegrationFingerprint ?? false
);
}
@@ -1015,12 +1015,12 @@ export class StateService<TAccount extends Account = Account>
value: boolean,
options?: StorageOptions
): Promise<void> {
const account = await this.getAccount(
const globals = await this.getGlobals(
this.reconcileOptions(options, await this.defaultOnDiskOptions())
);
account.settings.enableBrowserIntegrationFingerprint = value;
await this.saveAccount(
account,
globals.enableBrowserIntegrationFingerprint = value;
await this.saveGlobals(
globals,
this.reconcileOptions(options, await this.defaultOnDiskOptions())
);
}