Skip to content

Commit

Permalink
Manually cherry-pick #1012
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed Feb 18, 2022
1 parent cc3880c commit 8f03193
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 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)
}

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 Expand Up @@ -361,4 +366,4 @@ - (void)hide
Class RCTDevLoadingViewCls(void)
{
return RCTDevLoadingView.class;
}
}

0 comments on commit 8f03193

Please sign in to comment.