mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Manual: Clean up bridge.networking -> RCTModuleRegistry codemod
Summary: Spotted a few errors in Codemod that migrated bridge.networking calls to [_moduleRegistry moduleForName:"Networking"] calls. This diff fixes those mistakes. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D25499699 fbshipit-source-id: 29f296fc1011cf65d30e083e0ef001e3185edbfb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ad6705f142
commit
f50d9c41b2
@@ -113,7 +113,6 @@ static uint64_t monotonicTimeGetCurrentNanoseconds(void)
|
||||
@synthesize maxConcurrentLoadingTasks = _maxConcurrentLoadingTasks;
|
||||
@synthesize maxConcurrentDecodingTasks = _maxConcurrentDecodingTasks;
|
||||
@synthesize maxConcurrentDecodingBytes = _maxConcurrentDecodingBytes;
|
||||
@synthesize turboModuleRegistry = _turboModuleRegistry;
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
@@ -645,20 +644,14 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
progressBlock:(RCTImageLoaderProgressBlock)progressHandler
|
||||
completionBlock:(void (^)(NSError *error, id imageOrData, NSURLResponse *response))completionHandler
|
||||
{
|
||||
// Check if networking module is available
|
||||
if (RCT_DEBUG && ![_bridge respondsToSelector:@selector(networking)]
|
||||
&& ![_turboModuleRegistry moduleForName:"Networking"]) {
|
||||
RCTNetworking *networking = [_moduleRegistry moduleForName:"Networking"];
|
||||
if (RCT_DEBUG && !networking) {
|
||||
RCTLogError(@"No suitable image URL loader found for %@. You may need to "
|
||||
" import the RCTNetwork library in order to load images.",
|
||||
request.URL.absoluteString);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RCTNetworking *networking = [_moduleRegistry moduleForName:"Networking"];
|
||||
if (!networking) {
|
||||
networking = [_turboModuleRegistry moduleForName:"Networking"];
|
||||
}
|
||||
|
||||
// Check if networking module can load image
|
||||
if (RCT_DEBUG && ![networking canHandleRequest:request]) {
|
||||
RCTLogError(@"No suitable image URL loader found for %@", request.URL.absoluteString);
|
||||
|
||||
Reference in New Issue
Block a user