Migrate RCTDevLoadingView to RCTBundleManager

Summary:
See title.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D28192004

fbshipit-source-id: fd916237030ad51c7687e8196d7e0b6d3b3c02b5
This commit is contained in:
Ramanpreet Nara
2021-05-04 18:33:23 -07:00
committed by Facebook GitHub Bot
parent 4198c2bcb6
commit adaa1c98f6
+8 -6
View File
@@ -35,6 +35,7 @@ using namespace facebook::react;
}
@synthesize bridge = _bridge;
@synthesize bundleManager = _bundleManager;
RCT_EXPORT_MODULE()
@@ -63,12 +64,12 @@ RCT_EXPORT_MODULE()
return YES;
}
- (void)setBridge:(RCTBridge *)bridge
- (void)setBundleManager:(RCTBundleManager *)bundleManager
{
_bridge = bridge;
_bundleManager = bundleManager;
if (bridge.loading) {
[self showWithURL:bridge.bundleURL];
if (_bridge.loading) {
[self showWithURL:bundleManager.bundleURL];
}
}
@@ -104,11 +105,12 @@ RCT_EXPORT_MODULE()
- (NSString *)getTextForHost
{
if (self->_bridge.bundleURL == nil || self->_bridge.bundleURL.fileURL) {
NSURL *bundleURL = _bundleManager.bundleURL;
if (bundleURL == nil || bundleURL.fileURL) {
return @"React Native";
}
return [NSString stringWithFormat:@"%@:%@", self->_bridge.bundleURL.host, self->_bridge.bundleURL.port];
return [NSString stringWithFormat:@"%@:%@", bundleURL.host, bundleURL.port];
}
- (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor