File tree 1 file changed +4
-9
lines changed
packages/react-native/React/CoreModules
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,10 @@ void RCTOverrideAppearancePreference(NSString *const colorSchemeOverride)
39
39
static UITraitCollection *getKeyWindowTraitCollection ()
40
40
{
41
41
__block UITraitCollection *traitCollection = nil ;
42
- if (RCTIsMainQueue ()) {
43
- return RCTSharedApplication ().delegate .window .traitCollection ;
44
- } else {
45
- __block UITraitCollection* traitCollection = nil ;
46
- dispatch_sync (dispatch_get_main_queue (), ^{
47
- traitCollection = RCTSharedApplication ().delegate .window .traitCollection ;
48
- });
49
- return traitCollection;
50
- }
42
+ RCTUnsafeExecuteOnMainQueueSync (^{
43
+ traitCollection = RCTSharedApplication ().delegate .window .traitCollection ;
44
+ });
45
+ return traitCollection;
51
46
}
52
47
53
48
NSString *RCTColorSchemePreference (UITraitCollection *traitCollection)
You can’t perform that action at this time.
0 commit comments