Fix a bug where the Screen lock placeholder could be slow. (#2155)

* Only use the Task for the delayed window changes.
The timing was off with the Task when locking the device with the app open.

* Check the application state before unlocking the app.
On top of a), the app will reveal itself if you background during the success animation, b) the flow is run farrrr too many times, so the app is revealing itself way before the Face ID scan UI is complete - definitely need a state machine here.
This commit is contained in:
Doug
2023-11-22 18:58:14 +00:00
committed by GitHub
parent a21bc2cdd3
commit 4d011b9116
2 changed files with 15 additions and 11 deletions
@@ -108,7 +108,7 @@ class AppLockFlowCoordinator: CoordinatorProtocol {
if appLockService.biometricUnlockEnabled, appLockService.biometricUnlockTrusted {
showPlaceholder() // For the unlock background.
if await appLockService.unlockWithBiometrics() {
if await appLockService.unlockWithBiometrics(), UIApplication.shared.applicationState == .active {
actionsSubject.send(.unlockApp)
return
}
@@ -132,6 +132,7 @@ class AppLockFlowCoordinator: CoordinatorProtocol {
guard let self else { return }
switch action {
case .appUnlocked:
guard UIApplication.shared.applicationState == .active else { return }
actionsSubject.send(.unlockApp)
case .forceLogout:
actionsSubject.send(.forceLogout)