Ivan Valkou 5 лет назад
Родитель
Сommit
f03344c67c
1 измененных файлов с 2 добавлено и 8 удалено
  1. 2 8
      FreeAPS/Sources/Services/UnlockManager/UnlockManager.swift

+ 2 - 8
FreeAPS/Sources/Services/UnlockManager/UnlockManager.swift

@@ -25,20 +25,14 @@ final class BaseUnlockManager: UnlockManager {
 
             let reason = "We need to make sure you are the owner of the device."
 
-            if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
-                context.evaluatePolicy(
-                    .deviceOwnerAuthenticationWithBiometrics,
-                    localizedReason: reason,
-                    reply: handler
-                )
-            } else if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) {
+            if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) {
                 context.evaluatePolicy(
                     .deviceOwnerAuthentication,
                     localizedReason: reason,
                     reply: handler
                 )
             } else {
-                promise(.failure(UnlockError(error: error)))
+                handler(true, nil)
             }
         }
         .eraseToAnyPublisher()