Skip to content

Commit

Permalink
Respects user defaults when setting up HMRClient
Browse files Browse the repository at this point in the history
  • Loading branch information
stigi committed Sep 7, 2020
1 parent 902611f commit a594047
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions React/CoreModules/RCTDevSettings.mm
Original file line number Diff line number Diff line change
Expand Up @@ -405,17 +405,18 @@ - (void)addHandler:(id<RCTPackagerClientMethod>)handler forPackagerMethod:(NSStr

- (void)setupHMRClientWithBundleURL:(NSURL *)bundleURL
{
if (bundleURL && !bundleURL.fileURL) { // isHotLoadingAvailable check
if (bundleURL && !bundleURL.fileURL) {
NSString *const path = [bundleURL.path substringFromIndex:1]; // Strip initial slash.
NSString *const host = bundleURL.host;
NSNumber *const port = bundleURL.port;
BOOL isHotLoadingEnabled = self.isHotLoadingEnabled;
if (self.bridge) {
[self.bridge enqueueJSCall:@"HMRClient"
method:@"setup"
args:@[ @"ios", path, host, RCTNullIfNil(port), @(YES) ]
args:@[ @"ios", path, host, RCTNullIfNil(port), @(isHotLoadingEnabled) ]
completion:NULL];
} else {
self.invokeJS(@"HMRClient", @"setup", @[ @"ios", path, host, RCTNullIfNil(port), @(YES) ]);
self.invokeJS(@"HMRClient", @"setup", @[ @"ios", path, host, RCTNullIfNil(port), @(isHotLoadingEnabled) ]);
}
}
}
Expand Down

0 comments on commit a594047

Please sign in to comment.