Permalink
Browse files

Show yellowbox when we fail to load a local image

Reviewed By: achen1

Differential Revision: D4342295

fbshipit-source-id: 9411ffe9a376e1ed51fcadee718326d1d9443fff
  • Loading branch information...
mmmulani authored and facebook-github-bot committed Dec 19, 2016
1 parent d3d5d7b commit ac11eedfb0182370b47fd18c630898f2991f2169
Showing with 4 additions and 1 deletion.
  1. +1 −0 Libraries/Image/RCTLocalAssetImageLoader.m
  2. +3 −1 Libraries/Utilities/RCTLog.js
@@ -105,6 +105,7 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
completionHandler(nil, image);
} else {
NSString *message = [NSString stringWithFormat:@"Could not find image named %@", imageName];
RCTLogWarn(@"%@", message);
completionHandler(RCTErrorWithMessage(message), nil);
}
});
@@ -33,10 +33,12 @@ class RCTLog {
logFn,
'Level "' + level + '" not one of ' + Object.keys(levelsMap)
);
if (typeof global.nativeLoggingHook === 'undefined') {
if (typeof global.nativeLoggingHook === 'undefined' || level === 'warn') {
// We already printed in xcode, so only log here if using a js debugger
// or if we're trying to send a yellow box from native down.
console[logFn].apply(console, args);
}
return true;
}
}

0 comments on commit ac11eed

Please sign in to comment.