fix: biometrics timing loading (#1622)

This commit is contained in:
Mo
2022-09-23 09:59:16 -05:00
committed by GitHub
parent 4cdfcbfd95
commit 3c0d4fac76
3 changed files with 4 additions and 14 deletions

View File

@@ -960,10 +960,6 @@ export class SNApplication
| undefined | undefined
} }
async loadMobileUnlockTiming() {
return this.protectionService.loadMobileUnlockTiming()
}
getBiometricsTimingOptions() { getBiometricsTimingOptions() {
return this.protectionService.getBiometricsTimingOptions() return this.protectionService.getBiometricsTimingOptions()
} }

View File

@@ -87,6 +87,8 @@ export class SNProtectionService extends AbstractService<ProtectionEvent> implem
override handleApplicationStage(stage: ApplicationStage): Promise<void> { override handleApplicationStage(stage: ApplicationStage): Promise<void> {
if (stage === ApplicationStage.LoadedDatabase_12) { if (stage === ApplicationStage.LoadedDatabase_12) {
this.updateSessionExpiryTimer(this.getSessionExpiryDate()) this.updateSessionExpiryTimer(this.getSessionExpiryDate())
this.mobilePasscodeTiming = this.getPasscodeTiming()
this.mobileBiometricsTiming = this.getBiometricsTiming()
} }
return Promise.resolve() return Promise.resolve()
} }
@@ -284,11 +286,6 @@ export class SNProtectionService extends AbstractService<ProtectionEvent> implem
return this.storageService.getValue(StorageKey.MobileScreenshotPrivacyEnabled, StorageValueModes.Default, false) return this.storageService.getValue(StorageKey.MobileScreenshotPrivacyEnabled, StorageValueModes.Default, false)
} }
loadMobileUnlockTiming(): void {
this.mobilePasscodeTiming = this.getPasscodeTiming()
this.mobileBiometricsTiming = this.getBiometricsTiming()
}
private async validateOrRenewSession( private async validateOrRenewSession(
reason: ChallengeReason, reason: ChallengeReason,
{ fallBackToAccountPassword = true, requireAccountPassword = false } = {}, { fallBackToAccountPassword = true, requireAccountPassword = false } = {},

View File

@@ -19,10 +19,8 @@ const BiometricsLock = ({ application }: Props) => {
const [biometricsTimingOptions, setBiometricsTimingOptions] = useState(() => application.getBiometricsTimingOptions()) const [biometricsTimingOptions, setBiometricsTimingOptions] = useState(() => application.getBiometricsTimingOptions())
useEffect(() => { useEffect(() => {
const getHasBiometrics = async () => { const appHasBiometrics = application.hasBiometrics()
const appHasBiometrics = application.hasBiometrics() setHasBiometrics(appHasBiometrics)
setHasBiometrics(appHasBiometrics)
}
const hasBiometricsSupport = async () => { const hasBiometricsSupport = async () => {
const hasBiometricsAvailable = await ( const hasBiometricsAvailable = await (
@@ -30,7 +28,6 @@ const BiometricsLock = ({ application }: Props) => {
).getDeviceBiometricsAvailability?.() ).getDeviceBiometricsAvailability?.()
setSupportsBiometrics(hasBiometricsAvailable) setSupportsBiometrics(hasBiometricsAvailable)
} }
void getHasBiometrics()
void hasBiometricsSupport() void hasBiometricsSupport()
}, [application]) }, [application])