From adaa1c98f6e8576a42bf2ca5101dfbc28d7c2d4c Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 4 May 2021 18:31:35 -0700 Subject: [PATCH] Migrate RCTDevLoadingView to RCTBundleManager Summary: See title. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D28192004 fbshipit-source-id: fd916237030ad51c7687e8196d7e0b6d3b3c02b5 --- React/CoreModules/RCTDevLoadingView.mm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index ee8caf8a1cf..dd3b994cfae 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -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