From 8d161d9245f69fe81b0a49269874e48f88932042 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Mon, 11 Jan 2021 19:12:40 +0100 Subject: [PATCH] Improve system.service biometrics condition (#244) --- src/services/constants.service.ts | 2 ++ src/services/system.service.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/constants.service.ts b/src/services/constants.service.ts index d3cca66aec..ee1b3636b2 100644 --- a/src/services/constants.service.ts +++ b/src/services/constants.service.ts @@ -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; } diff --git a/src/services/system.service.ts b/src/services/system.service.ts index 4edf0e3a2e..d5d0d6ea01 100644 --- a/src/services/system.service.ts +++ b/src/services/system.service.ts @@ -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(ConstantsService.biometricFingerprintValidated) && this.vaultTimeoutService.biometricLocked; + if (doRefresh && !biometricLockedFingerprintValidated) { clearInterval(this.reloadInterval); this.reloadInterval = null; this.messagingService.send('reloadProcess');