Browse Source

fix faceid

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
7b381aa027

+ 8 - 6
iOSClient/AppDelegate.swift

@@ -713,12 +713,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
               let passcodeViewController = privacyProtectionWindow?.rootViewController?.presentedViewController as? TOPasscodeViewController
               let passcodeViewController = privacyProtectionWindow?.rootViewController?.presentedViewController as? TOPasscodeViewController
         else { return }
         else { return }
 
 
-        LAContext().evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { (success, error) in
-            if success {
-                DispatchQueue.main.async {
-                    passcodeViewController.dismiss(animated: true) {
-                        self.hidePrivacyProtectionWindow()
-                        self.requestAccount()
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
+            LAContext().evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { (success, error) in
+                if success {
+                    DispatchQueue.main.async {
+                        passcodeViewController.dismiss(animated: true) {
+                            self.hidePrivacyProtectionWindow()
+                            self.requestAccount()
+                        }
                     }
                     }
                 }
                 }
             }
             }

+ 2 - 1
iOSClient/Networking/NCNetworkingProcessUpload.swift

@@ -58,6 +58,7 @@ class NCNetworkingProcessUpload: NSObject {
 
 
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
         let applicationState = UIApplication.shared.applicationState
         let applicationState = UIApplication.shared.applicationState
+        let isPasscodePresented = appDelegate.isPasscodePresented()
         let queue = DispatchQueue.global()
         let queue = DispatchQueue.global()
         var maxConcurrentOperationUpload = 10
         var maxConcurrentOperationUpload = 10
 
 
@@ -150,7 +151,7 @@ class NCNetworkingProcessUpload: NSObject {
                 }
                 }
 
 
                 // verify delete Asset Local Identifiers in auto upload (DELETE Photos album)
                 // verify delete Asset Local Identifiers in auto upload (DELETE Photos album)
-                if applicationState == .active && counterUpload == 0 && !appDelegate.isPasscodePresented() {
+                if applicationState == .active && counterUpload == 0 && !isPasscodePresented {
                     self.deleteAssetLocalIdentifiers(account: account.account) {
                     self.deleteAssetLocalIdentifiers(account: account.account) {
                         self.startTimer()
                         self.startTimer()
                     }
                     }