Browse Source

Check dark mode at first launch - Fix #1052

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 5 years ago
parent
commit
ab0e1ad23c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      iOSClient/Utility/CCUtility.m

+ 5 - 0
iOSClient/Utility/CCUtility.m

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