Skip to content

Commit

Permalink
Running RCTKeyWindow on main thread (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
MorganTrudeau authored Sep 2, 2024
1 parent f066c0c commit 646642b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/RNBootSplash.mm
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ + (void)onJavaScriptDidFailToLoad {
}

- (NSDictionary *)constantsToExport {
UIWindow *window = RCTKeyWindow();
__block bool darkModeEnabled = false;

RCTUnsafeExecuteOnMainQueueSync(^{
UIWindow *window = RCTKeyWindow();
darkModeEnabled = window != nil && window.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark;
});

Expand Down

0 comments on commit 646642b

Please sign in to comment.