marinofaggiana 4 年之前
父節點
當前提交
feeb9767b9
共有 3 個文件被更改,包括 8 次插入12 次删除
  1. 2 3
      iOSClient/AppDelegate.swift
  2. 1 1
      iOSClient/PushNotification/NCPushNotification.m
  3. 5 8
      iOSClient/Settings/NCSettings.m

+ 2 - 3
iOSClient/AppDelegate.swift

@@ -9,10 +9,9 @@ import TOPasscodeViewController
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
 
-    var window: UIWindow?
     var backgroundSessionCompletionHandler: (() -> Void)?
-    var preferredUserInterfaceStyle: UIUserInterfaceStyle?
-    
+    var window: UIWindow?
+
     @objc var account: String = ""
     @objc var urlBase: String = ""
     @objc var user: String = ""

+ 1 - 1
iOSClient/PushNotification/NCPushNotification.m

@@ -50,7 +50,7 @@
 
 - (void)pushNotification
 {
-    if (appDelegate.account == nil || appDelegate.account.length == 0 || self.pushKitToken.length == 0) { return; }
+    if (appDelegate.account == "" || self.pushKitToken.length == 0) { return; }
     
     for (tableAccount *result in [[NCManageDatabase shared] getAllAccount]) {
         

+ 5 - 8
iOSClient/Settings/NCSettings.m

@@ -28,9 +28,9 @@
 #import "NCManageEndToEndEncryption.h"
 #import "NCBridgeSwift.h"
 #import "NSNotificationCenter+MainThread.h"
+#import <LocalAuthentication/LocalAuthentication.h>
 #import <TOPasscodeViewController/TOPasscodeViewController.h>
 
-
 #define alertViewEsci 1
 #define alertViewAzzeraCache 2
 
@@ -284,13 +284,10 @@
         if ([[rowDescriptor.value valueData] boolValue] == YES) {
             [CCUtility setDarkModeDetect:true];
             // detect Dark Mode
-            if (@available(iOS 12.0, *)) {
-                appDelegate.preferredUserInterfaceStyle = self.traitCollection.userInterfaceStyle;
-                if (appDelegate.preferredUserInterfaceStyle == UIUserInterfaceStyleDark) {
-                    [CCUtility setDarkMode:YES];
-                } else {
-                    [CCUtility setDarkMode:NO];
-                }
+            if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
+                [CCUtility setDarkMode:YES];
+            } else {
+                [CCUtility setDarkMode:NO];
             }
         } else {
             [CCUtility setDarkModeDetect:false];