Improve system.service biometrics condition (#244)

This commit is contained in:
Oscar Hinton 2021-01-11 19:12:40 +01:00 committed by GitHub
parent 3ac42f2f44
commit 8d161d9245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -28,6 +28,7 @@ export class ConstantsService {
static readonly biometricUnlockKey: string = 'biometric';
static readonly biometricText: string = 'biometricText';
static readonly biometricAwaitingAcceptance: string = 'biometricAwaitingAcceptance';
static readonly biometricFingerprintValidated: string = 'biometricFingerprintValidated';
readonly environmentUrlsKey: string = ConstantsService.environmentUrlsKey;
readonly disableGaKey: string = ConstantsService.disableGaKey;
@ -57,4 +58,5 @@ export class ConstantsService {
readonly biometricUnlockKey: string = ConstantsService.biometricUnlockKey;
readonly biometricText: string = ConstantsService.biometricText;
readonly biometricAwaitingAcceptance: string = ConstantsService.biometricAwaitingAcceptance;
readonly biometricFingerprintValidated: string = ConstantsService.biometricFingerprintValidated;
}

View File

@ -19,7 +19,7 @@ export class SystemService implements SystemServiceAbstraction {
}
startProcessReload(): void {
if (this.vaultTimeoutService.pinProtectedKey != null || this.vaultTimeoutService.biometricLocked || this.reloadInterval != null) {
if (this.vaultTimeoutService.pinProtectedKey != null || this.reloadInterval != null) {
return;
}
this.cancelProcessReload();
@ -31,7 +31,9 @@ export class SystemService implements SystemServiceAbstraction {
// Don't refresh if they are still active in the window
doRefresh = diffSeconds >= 5000;
}
if (doRefresh) {
const biometricLockedFingerprintValidated =
await this.storageService.get<boolean>(ConstantsService.biometricFingerprintValidated) && this.vaultTimeoutService.biometricLocked;
if (doRefresh && !biometricLockedFingerprintValidated) {
clearInterval(this.reloadInterval);
this.reloadInterval = null;
this.messagingService.send('reloadProcess');