Handle error object for biometric lock (#9070)

This commit is contained in:
Matt Gibson 2024-05-07 17:43:42 -04:00 committed by GitHub
parent 7bb37877ee
commit ea7d1ff6ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -143,15 +143,17 @@ export class LockComponent extends BaseLockComponent {
try {
success = await super.unlockBiometric();
} catch (e) {
const error = BiometricErrors[e as BiometricErrorTypes];
const error = BiometricErrors[e?.message as BiometricErrorTypes];
if (error == null) {
this.logService.error("Unknown error: " + e);
return false;
}
this.biometricError = this.i18nService.t(error.description);
} finally {
this.pendingBiometric = false;
}
this.pendingBiometric = false;
return success;
}