Skip to content

Commit

Permalink
make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjhughes committed Sep 10, 2023
1 parent 3d194cc commit 3da09de
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/react-native/React/CoreModules/RCTAppearance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ void RCTOverrideAppearancePreference(NSString *const colorSchemeOverride)
}

UITraitCollection* getKeyWindowTraitCollection() {
if ([NSThread isMainThread]) {
return [UIApplication sharedApplication].delegate.window.traitCollection;
} else {
__block UITraitCollection* traitCollection = nil;
dispatch_sync(dispatch_get_main_queue(), ^{
traitCollection = [UIApplication sharedApplication].delegate.window.traitCollection;
});
return traitCollection;
}
__block UITraitCollection* traitCollection = nil;
RCTExecuteOnMainQueue(^{
traitCollection = RCTSharedApplication().delegate.window.traitCollection;
});
return traitCollection;
}

NSString *RCTColorSchemePreference(UITraitCollection *traitCollection)
Expand Down

0 comments on commit 3da09de

Please sign in to comment.