Skip to content

Commit

Permalink
Fixes Appearance user interface style when app run from background (#…
Browse files Browse the repository at this point in the history
…46021)

Summary:
Fixes #46015.

## Changelog:

[IOS] [FIXED] - Fixes Appearance user interface style when app run from background

Pull Request resolved: #46021

Test Plan: Demo in #46015.

Reviewed By: christophpurrer

Differential Revision: D61536857

Pulled By: cipolleschi

fbshipit-source-id: ee06cb25b5fc4fa72d646efe212738e54b9ef858
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Aug 20, 2024
1 parent 52888c0 commit efa9711
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-native/React/CoreModules/RCTAppearance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ void RCTUseKeyWindowForSystemStyle(BOOL useMainScreen)
return appearances[@(traitCollection.userInterfaceStyle)];
}

if (!traitCollection) {
traitCollection = [UITraitCollection currentTraitCollection];
}

UIUserInterfaceStyle systemStyle = sUseKeyWindowForSystemStyle ? RCTKeyWindow().traitCollection.userInterfaceStyle
: traitCollection.userInterfaceStyle;

return appearances[@(systemStyle)] ?: RCTAppearanceColorSchemeLight;
}

Expand Down

0 comments on commit efa9711

Please sign in to comment.