File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/react-native-web/src/modules/ImageLoader Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,13 @@ const ImageLoader = {
8181 release ( requestId : number ) {
8282 const request = requests [ requestId ] ;
8383 if ( request ) {
84- const { image, cleanup } = request ;
84+ const { image, cleanup, source } = request ;
8585 if ( cleanup ) cleanup ( ) ;
8686
8787 image . onerror = null ;
8888 image . onload = null ;
8989 image . src = '' ;
90+ ImageUriCache . remove ( source . uri ) ;
9091 delete requests [ requestId ] ;
9192 }
9293 } ,
@@ -135,14 +136,16 @@ const ImageLoader = {
135136
136137 const handleLoad = ( ) => {
137138 // avoid blocking the main thread
138- const onDecode = ( ) =>
139+ const onDecode = ( ) => {
140+ ImageUriCache . add ( source . uri ) ;
139141 onLoad ( {
140142 source : {
141143 uri : image . src ,
142144 width : image . naturalWidth ,
143145 height : image . naturalHeight
144146 }
145147 } ) ;
148+ } ;
146149
147150 // Safari currently throws exceptions when decoding svgs.
148151 // We want to catch that error and allow the load handler
You can’t perform that action at this time.
0 commit comments