File tree 1 file changed +5
-2
lines changed
packages/react-native-web/src/modules/ImageLoader
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,13 @@ const ImageLoader = {
81
81
release ( requestId : number ) {
82
82
const request = requests [ requestId ] ;
83
83
if ( request ) {
84
- const { image, cleanup } = request ;
84
+ const { image, cleanup, source } = request ;
85
85
if ( cleanup ) cleanup ( ) ;
86
86
87
87
image . onerror = null ;
88
88
image . onload = null ;
89
89
image . src = '' ;
90
+ ImageUriCache . remove ( source . uri ) ;
90
91
delete requests [ requestId ] ;
91
92
}
92
93
} ,
@@ -135,14 +136,16 @@ const ImageLoader = {
135
136
136
137
const handleLoad = ( ) => {
137
138
// avoid blocking the main thread
138
- const onDecode = ( ) =>
139
+ const onDecode = ( ) => {
140
+ ImageUriCache . add ( source . uri ) ;
139
141
onLoad ( {
140
142
source : {
141
143
uri : image . src ,
142
144
width : image . naturalWidth ,
143
145
height : image . naturalHeight
144
146
}
145
147
} ) ;
148
+ } ;
146
149
147
150
// Safari currently throws exceptions when decoding svgs.
148
151
// We want to catch that error and allow the load handler
You can’t perform that action at this time.
0 commit comments