Simplify the isDarkModeEnabled check
authorDaniel Pham <pham.dany@gmail.com>
Fri, 4 Mar 2016 04:48:30 +0000 (23:48 -0500)
committerDaniel Pham <pham.dany@gmail.com>
Fri, 4 Mar 2016 04:48:30 +0000 (23:48 -0500)
atom/browser/browser_mac.mm

index affeead..f5859df 100644 (file)
@@ -27,7 +27,7 @@ void Browser::Show() {
 }
 
 bool Browser::IsDarkModeEnabled() {
-  NSString *mode = CFBridgingRelease(CFPreferencesCopyValue((CFStringRef)@"AppleInterfaceStyle", kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost));
+  NSString *mode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
   return [mode isEqualToString: @"Dark"];
 }