@@ -266,16 +266,21 @@ - (void)showProgressMessage:(NSString *)message
266
266
267
267
- (void )showOfflineMessage
268
268
{
269
- RCTUIColor *color = [RCTUIColor whiteColor ]; // TODO(macOS GH#774)
270
- RCTUIColor *backgroundColor = [RCTUIColor blackColor ]; // TODO(macOS GH#774)
271
-
272
- if ([self isDarkModeEnabled ]) {
273
- color = [RCTUIColor blackColor ]; // TODO(macOS GH#774)
274
- backgroundColor = [RCTUIColor whiteColor ]; // TODO(macOS GH#774)
275
- }
269
+ // [TODO(macOS GH#774) - isDarkModeEnabled should only be run on the main thread
270
+ __weak __typeof (self) weakSelf = self;
271
+ RCTExecuteOnMainQueue (^{
272
+ RCTUIColor *color = [RCTUIColor whiteColor ]; // TODO(macOS GH#774)
273
+ RCTUIColor *backgroundColor = [RCTUIColor blackColor ]; // TODO(macOS GH#774)
274
+
275
+ if ([weakSelf isDarkModeEnabled ]) {
276
+ color = [RCTUIColor blackColor ]; // TODO(macOS GH#774)
277
+ backgroundColor = [RCTUIColor whiteColor ]; // TODO(macOS GH#774)
278
+ }
276
279
277
- NSString *message = [NSString stringWithFormat: @" Connect to %@ to develop JavaScript." , RCT_PACKAGER_NAME];
278
- [self showMessage: message color: color backgroundColor: backgroundColor];
280
+ NSString *message = [NSString stringWithFormat: @" Connect to %@ to develop JavaScript." , RCT_PACKAGER_NAME];
281
+ [weakSelf showMessage: message color: color backgroundColor: backgroundColor];
282
+ });
283
+ // ]TODO(macOS GH#774)
279
284
}
280
285
281
286
- (BOOL )isDarkModeEnabled
@@ -361,4 +366,4 @@ - (void)hide
361
366
Class RCTDevLoadingViewCls (void )
362
367
{
363
368
return RCTDevLoadingView.class ;
364
- }
369
+ }
0 commit comments