Fixed double-callback for cached images
Summary: public A missing return statement in RCTImageLoader meant that cached images would be loaded twice - once from cache and again from the source. This was mostly innocuous, causing only a slight perf regression due to the image cache being effectively disabled, however in some cases (such as RCTImageEditingManager.cropImage) it caused the success callback to fire twice, resulting in a crash. Reviewed By: fkgozali Differential Revision: D2684956 fb-gh-sync-id: 7580a6fbfe00a30807951803e04bfcdbee3bb80a
This commit is contained in:
parent
274c5c78c4
commit
f827a513a1
|
@ -290,6 +290,7 @@ RCT_EXPORT_MODULE()
|
||||||
NSCachedURLResponse *cachedResponse = [_URLCache cachedResponseForRequest:request];
|
NSCachedURLResponse *cachedResponse = [_URLCache cachedResponseForRequest:request];
|
||||||
if (cachedResponse) {
|
if (cachedResponse) {
|
||||||
processResponse(cachedResponse.response, cachedResponse.data, nil);
|
processResponse(cachedResponse.response, cachedResponse.data, nil);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download image
|
// Download image
|
||||||
|
|
Loading…
Reference in New Issue