Skip to content

Commit

Permalink
Fixing change in RCTImageFromLocalAssetURL behavior. facebook/react-n…
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasjunior committed Nov 12, 2017
1 parent beaecb4 commit e91d6d0
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions ios/RNPhotoView.m
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,22 @@ - (void)setSource:(NSDictionary *)source {
}
_source = source;
NSURL *imageURL = [NSURL URLWithString:uri];
UIImage *image = RCTImageFromLocalAssetURL(imageURL);
if (image) { // if local image
[self setImage:image];
return;

@try {
UIImage *image = RCTImageFromLocalAssetURL(imageURL);
if (image) { // if local image
[self setImage:image];
if (_onPhotoViewerLoad) {
_onPhotoViewerLoad(nil);
}
if (_onPhotoViewerLoadEnd) {
_onPhotoViewerLoadEnd(nil);
}
return;
}
}
@catch (NSException *exception) {
NSLog(@"%@", exception.reason);
}

NSURLRequest *request = [[NSURLRequest alloc] initWithURL:imageURL];
Expand Down

0 comments on commit e91d6d0

Please sign in to comment.