mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Ps/pm 5537/move biometric unlock to state providers (#8099)
* Establish biometric unlock enabled in state providers * Use biometric state service for biometric state values * Migrate biometricUnlock * Fixup Dependencies * linter and import fixes * Fix injection * Fix merge * Use boolean constructor as mapper * Conform to documented test naming conventions * Commit documentation suggestion Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com> * Fix merge commit * Fix test names --------- Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
This commit is contained in:
@@ -378,24 +378,6 @@ export class StateService<
|
||||
);
|
||||
}
|
||||
|
||||
async getBiometricUnlock(options?: StorageOptions): Promise<boolean> {
|
||||
return (
|
||||
(await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())))
|
||||
?.settings?.biometricUnlock ?? false
|
||||
);
|
||||
}
|
||||
|
||||
async setBiometricUnlock(value: boolean, options?: StorageOptions): Promise<void> {
|
||||
const account = await this.getAccount(
|
||||
this.reconcileOptions(options, await this.defaultOnDiskOptions()),
|
||||
);
|
||||
account.settings.biometricUnlock = value;
|
||||
await this.saveAccount(
|
||||
account,
|
||||
this.reconcileOptions(options, await this.defaultOnDiskOptions()),
|
||||
);
|
||||
}
|
||||
|
||||
async getCanAccessPremium(options?: StorageOptions): Promise<boolean> {
|
||||
if (!(await this.getIsAuthenticated(options))) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user