File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
packages/react-native-web/src Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -159,11 +159,6 @@ function resolveSource(source: ?Source): ImageSource {
159
159
return resolvedSource ;
160
160
}
161
161
162
- // resolve any URI that might have a local blob URL created with `createObjectURL`
163
- function resolveBlobUri ( source : ImageSource ) : string {
164
- return ImageLoader . resolveBlobUri ( source . uri ) ;
165
- }
166
-
167
162
function getSourceToDisplay ( main : SourceState , fallback : SourceState ) {
168
163
if ( main . status === LOADED ) return main . source ;
169
164
@@ -222,7 +217,7 @@ const Image: React.AbstractComponent<
222
217
const fallbackSource = useSource ( imageLoadingProps , defaultSource ) ;
223
218
const mainSource = useSource ( imageLoadingProps , source ) ;
224
219
const availableSource = getSourceToDisplay ( mainSource , fallbackSource ) ;
225
- const displayImageUri = resolveBlobUri ( availableSource ) ;
220
+ const displayImageUri = ImageLoader . resolveUri ( availableSource . uri ) ;
226
221
const imageSizeStyle = resolveAssetDimensions ( availableSource ) ;
227
222
228
223
const [ layout , updateLayout ] = React . useState ( { } ) ;
Original file line number Diff line number Diff line change @@ -211,7 +211,8 @@ const ImageLoader = {
211
211
} ) ;
212
212
return Promise . resolve ( result ) ;
213
213
} ,
214
- resolveBlobUri ( uri : string ) : string {
214
+ // Resolves thr local blob for URIs loaded with `fetch`, otherwise just returns the URI
215
+ resolveUri ( uri : string ) : string {
215
216
for ( const key in requests ) {
216
217
const request = requests [ key ] ;
217
218
if ( request . source . uri === uri ) {
You can’t perform that action at this time.
0 commit comments