marinofaggiana 4 éve
szülő
commit
5856032d42
1 módosított fájl, 5 hozzáadás és 13 törlés
  1. 5 13
      iOSClient/AppDelegate.swift

+ 5 - 13
iOSClient/AppDelegate.swift

@@ -69,9 +69,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             return self.dark
         }
         set(value) {
-            self.dark = value
-            NCBrandColor.shared.setDarkMode(value)
-            NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeTheming)
+            if value != self.dark {
+                self.dark = value
+                NCBrandColor.shared.setDarkMode(value)
+                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeTheming)
+            }
         }
     }
 
@@ -86,16 +88,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             FirebaseApp.configure()
         }
         
-        if #available(iOS 13.0, *) {
-            if UITraitCollection.current.userInterfaceStyle == .dark {
-                darkMode = true
-            } else {
-                darkMode = false
-            }            
-        } else {
-            darkMode = false
-        }
-        
         CCUtility.createDirectoryStandard()
         CCUtility.emptyTemporaryDirectory()