Skip to content

Commit

Permalink
fix(ios): images with non-encoded urls are not displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg authored and hippy-actions[bot] committed Jan 25, 2024
1 parent 952f2f7 commit 0826bf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ios/sdk/component/image/HippyImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,9 @@ - (void)loadImage:(UIImage *)image url:(NSString *)url error:(NSError *)error ne
return;
}
NSDictionary *source = [self.source firstObject];
NSString *currentImageURLString = [source objectForKey:@"uri"];
BOOL shouldContinue = url && currentImageURLString && [url isEqualToString:currentImageURLString];
NSString *sourceURL = [source objectForKey:@"uri"];
NSString *encodedSourceURL = [[NSURL URLWithString:sourceURL] absoluteString];
BOOL shouldContinue = url && sourceURL && ([url isEqualToString:encodedSourceURL] || [url isEqualToString:sourceURL]);
if (!shouldContinue) {
return;
}
Expand Down

0 comments on commit 0826bf2

Please sign in to comment.