mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
Correctly set biometric state on connect failure
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
<div class="box-content-row box-content-row-checkbox" appBoxRow>
|
||||
<label for="biometric">{{'unlockWithBiometrics' | i18n}}</label>
|
||||
<input id="biometric" type="checkbox" (change)="updateBiometric()" [checked]="biometric">
|
||||
<input id="biometric" type="checkbox" (change)="updateBiometric()" [(ngModel)]="biometric">
|
||||
</div>
|
||||
<a class="box-content-row box-content-row-flex text-default" href="#" appStopClick appBlurClick
|
||||
(click)="lock()">
|
||||
|
||||
@@ -208,10 +208,6 @@ export class SettingsComponent implements OnInit {
|
||||
|
||||
async updateBiometric() {
|
||||
if (this.biometric) {
|
||||
this.biometric = false;
|
||||
await this.storageService.remove(ConstantsService.biometricUnlockKey);
|
||||
this.vaultTimeoutService.biometricLocked = false;
|
||||
} else {
|
||||
const submitted = Swal.fire({
|
||||
heightAuto: false,
|
||||
buttonsStyling: false,
|
||||
@@ -242,8 +238,14 @@ export class SettingsComponent implements OnInit {
|
||||
if (this.biometric === false) {
|
||||
this.platformUtilsService.showToast('error', this.i18nService.t('errorEnableBiometricTitle'), this.i18nService.t('errorEnableBiometricDesc'));
|
||||
}
|
||||
}).catch((e) => {
|
||||
// Handle connection errors
|
||||
this.biometric = false;
|
||||
})
|
||||
]);
|
||||
} else {
|
||||
await this.storageService.remove(ConstantsService.biometricUnlockKey);
|
||||
this.vaultTimeoutService.biometricLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user