Sfoglia il codice sorgente

Check dark mode at first launch - Fix #1052

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 5 anni fa
parent
commit
ab0e1ad23c
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      iOSClient/Utility/CCUtility.m

+ 5 - 0
iOSClient/Utility/CCUtility.m

@@ -659,6 +659,11 @@
 
 + (BOOL)getDarkMode
 {
+    if ([self getDarkModeDetect]) {
+        if (@available(iOS 12.0, *)) {
+            return [UIScreen mainScreen].traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark;
+        }
+    }
     return [[UICKeyChainStore stringForKey:@"darkMode" service:k_serviceShareKeyChain] boolValue];
 }