Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call +[NSAppearance currentAppearance] on the main thread #1012

23 changes: 14 additions & 9 deletions React/CoreModules/RCTDevLoadingView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,21 @@ - (void)showProgressMessage:(NSString *)message

- (void)showOfflineMessage
{
RCTUIColor *color = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
RCTUIColor *backgroundColor = [RCTUIColor blackColor]; // TODO(macOS GH#774)

if ([self isDarkModeEnabled]) {
color = [RCTUIColor blackColor]; // TODO(macOS GH#774)
backgroundColor = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
}
// [TODO(macOS GH#774) - isDarkModeEnabled should only be run on the main thread
__weak __typeof(self) weakSelf = self;
RCTExecuteOnMainQueue(^{
RCTUIColor *color = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
RCTUIColor *backgroundColor = [RCTUIColor blackColor]; // TODO(macOS GH#774)

if ([weakSelf isDarkModeEnabled]) {
color = [RCTUIColor blackColor]; // TODO(macOS GH#774)
backgroundColor = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
}
amgleitman marked this conversation as resolved.
Show resolved Hide resolved

NSString *message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME];
[self showMessage:message color:color backgroundColor:backgroundColor];
NSString *message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME];
[weakSelf showMessage:message color:color backgroundColor:backgroundColor];
});
// ]TODO(macOS GH#774)
}

- (BOOL)isDarkModeEnabled
Expand Down
58 changes: 29 additions & 29 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ SPEC CHECKSUMS:
boost-for-react-native: 8f7c9ecfe357664c072ffbe2432569667cbf1f1b
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: ed15e075aa758ac0e4c1f8b830bd4e4d40d669e8
FBLazyVector: 78833e5b71477e99d0c461260b15805300d8641a
FBReactNativeSpec: 443ba1d306c631c846dd7aca2a975387c9cc7bc7
FBLazyVector: ebf827c1137d58460e91013ad341f91a57ff2fd8
FBReactNativeSpec: f1236597074fcb9981477abfad7af8f97ea63fd6
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c
Expand All @@ -558,34 +558,34 @@ SPEC CHECKSUMS:
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: 43adc9ce880eb76792f88c011773cb5c664c1419
RCTRequired: d93d172489b8c773611e3efd9e227f5364594dd6
RCTTypeSafety: 3fc1581c2a865e39da6f99845e0ac6a8d9264460
React: 2f225b706f487a4c28da24f397cf398ccd39e982
React-callinvoker: b405a5dddbe24432f30a609ade5a19b51a46664e
React-Core: c9f3e60e3317528fdf90b41626a4f05f947aee08
React-CoreModules: f72a78971f386eee4c2100819278316b6f877491
React-cxxreact: 918aea0822c0211558092ae051f51e67d5306cb0
React-jsi: 11cd72d65a3435ab8ff942f63070ff3152bf0865
React-jsiexecutor: cfd80e02b8374637f4916150d8ee0d5f17afb9d2
React-jsinspector: 3171bf801725090c0dacc3e262f98bed08d69fdc
React-logger: f0d2226ebca93060b9a823722d9fec2606d7e7fe
React-perflogger: a0318f108de40b646149abe1cc1e949e2ac666c2
React-RCTActionSheet: ab8183f6cc730c57f466a9278edb01077e8fedd0
React-RCTAnimation: 48abe93d62ba56c83860c8e4c8fc7864e79c4a32
React-RCTBlob: c09e48087fa0b1843b1e72c865d2942847c2177e
React-RCTImage: e5cc9ae582ebb8e522cbdb4f5832178b5f06f41a
React-RCTLinking: 8ede7e34da8c6b4a0d84e9cb6bd7cccdb194763b
React-RCTNetwork: baa74ca81816e4c2d0a35e8c8e5dc55556dceff2
React-RCTPushNotification: b6c085f1e2027651cf5c45f1404c685075fb6dae
React-RCTSettings: d1497a02d747b9a7125d3c13fc97a04a17cb625c
React-RCTTest: bfe35790510a0dadb4677b87eca86762e0ca6df9
React-RCTText: 5268eb98f9ed610f06a41f2713fe029cfb0d159c
React-RCTVibration: 2374c6ae5cd333aecc32207780ba42d090b8e549
React-runtimeexecutor: de57453247bb893e197996c97355de11be14687d
RCTRequired: 70d6e44fd49b73a356ace7fff03ebd6a6055a794
RCTTypeSafety: 853cc09650317f266858fe64a49adfade5bdb507
React: 2f28a8887149351ae6c3d5ad99e81b7fbc3cd3a0
React-callinvoker: 32aac90d294beacf1b87a557281683979ced1b2e
React-Core: 056be4275ad4304b50962d6b1a502559083caf33
React-CoreModules: 4d907f698dc3174a1ec7af7651a8feb75d03bf01
React-cxxreact: a5b4f5c5f2cf058db8008093524e90adba16206f
React-jsi: 6b41823090b72f585e7ef1145edb0466eafe86e8
React-jsiexecutor: 6dee4b37eb64deb7a097d3f3f69d524855e5e017
React-jsinspector: d3a00e805958a9573a635f6fe131c27e0facc08c
React-logger: 2985e43d81170e89d8c0e3d7d9ae89e3e15a0862
React-perflogger: 45719a6d33b673135604f4910d61a1c4174aba79
React-RCTActionSheet: 4f70b3466af85f80b1047849db4266ca9c1c8a90
React-RCTAnimation: 8c1e372a3b726e0fce6585be11b79f73a7752720
React-RCTBlob: ace846e33dbe865f95255dc170342aa92760f618
React-RCTImage: 3c9592dd1a890524d4e01d2bd521c5f8cb59b3b0
React-RCTLinking: e2ffc806b5fbab75c5954361f9596c0f97c31efc
React-RCTNetwork: 7ac78536ca124d22f7dd93287b411c8a03835a91
React-RCTPushNotification: 032269ce39273b745723188b2173a47c32ed265b
React-RCTSettings: a7ae59ca4bc6c095cc77111964b5b48439f0e1f4
React-RCTTest: 63650a03894db33e06a9847ee08b71d14f6743b1
React-RCTText: a1a62bb79c18818ac340e3929b64a7741769b317
React-RCTVibration: 0252fc1d2e4d7487f24a61d0ba420e92c7a3fcc3
React-runtimeexecutor: b43eb92fa9bc1475a67dfd39c6c7f6b973cd0c3d
React-TurboModuleCxx-RNW: f2e32cbfced49190a61d66c993a8975de79a158a
React-TurboModuleCxx-WinRTPort: 42aadf2acef5d136d987df13aef3f0f2487a4aba
ReactCommon: fd25a74759c207c56ac433e996fa19ad9c4b5a04
Yoga: 602a226654e13710c61f951673946820bef68ce9
React-TurboModuleCxx-WinRTPort: 33943de08957f524b0b24f1e7466fee879807ae6
ReactCommon: d849454f42b3b5a84b064426940477cd6cfd6678
Yoga: b5ccb900d6ff873c37ad1b40d4d9f68bde5e685d
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: c7a7110b242497f2bf323ba74caedb9ee61ee05e
Expand Down