mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add cache control check to multisource (#47357)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47357 `MultiSourceHelper` should not yield an `ImageSource` that has its cache control policy set to `RELOAD`. This change skips such sources when computing the bestCached item (but not best item) Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D65337414 fbshipit-source-id: bdd0d55f4a65128b141a1c7a132dba085232fa11
This commit is contained in:
1 parent
6ab7b70241
commit
7211119d23
1 file changed
+4
+4
@@ -8,6 +8,7 @@
|
||||
package com.facebook.react.views.imagehelper
|
||||
|
||||
import com.facebook.imagepipeline.core.ImagePipelineFactory
|
||||
import com.facebook.react.modules.fresco.ImageCacheControl
|
||||
|
||||
/** Helper class for dealing with multisource images. */
|
||||
public object MultiSourceHelper {
|
||||
@@ -62,7 +63,10 @@ public object MultiSourceHelper {
|
||||
best = source
|
||||
}
|
||||
if (precision < bestCachePrecision &&
|
||||
source.cacheControl != ImageCacheControl.RELOAD &&
|
||||
(imagePipeline.isInBitmapMemoryCache(source.uri) ||
|
||||
// TODO: T206445115 isInDiskCacheSync is a blocking operation, we should move this to
|
||||
// a separate thread
|
||||
imagePipeline.isInDiskCacheSync(source.uri))) {
|
||||
bestCachePrecision = precision
|
||||
bestCached = source
|
||||
|
||||
Reference in new issue
Block a user