@@ -243,6 +243,7 @@ const imageCacheHoc = <P extends object>(
243
243
244
244
// Set url from source prop
245
245
const url = traverse ( this . props ) . get ( [ 'source' , 'uri' ] )
246
+ const permanent = this . props . permanent ? true : false
246
247
247
248
// Add a cache lock to file with this name (prevents concurrent <CacheableImage> components from pruning a file with this name from cache).
248
249
const fileName = this . fileSystem . getFileNameFromUrl ( url )
@@ -251,7 +252,7 @@ const imageCacheHoc = <P extends object>(
251
252
// Init the image cache logic
252
253
if ( ! this . invalidUrl ) {
253
254
this . subscription = this . fileSystem
254
- . observable ( url , this . componentId )
255
+ . observable ( url , this . componentId , permanent )
255
256
. pipe ( takeUntil ( this . unmounted$ . pipe ( skip ( 1 ) ) ) )
256
257
. subscribe ( ( info ) => this . onSourceLoaded ( info ) )
257
258
}
@@ -280,12 +281,13 @@ const imageCacheHoc = <P extends object>(
280
281
FileSystem . lockCacheFile ( nextFileName , this . componentId )
281
282
282
283
this . invalidUrl = ! this . _validateImageComponent ( )
284
+ const permanent = this . props . permanent ? true : false
283
285
284
286
// Init the image cache logic
285
287
this . subscription ?. unsubscribe ( )
286
288
if ( ! this . invalidUrl ) {
287
289
this . subscription = this . fileSystem
288
- . observable ( nextUrl , this . componentId )
290
+ . observable ( nextUrl , this . componentId , permanent )
289
291
. pipe ( takeUntil ( this . unmounted$ . pipe ( skip ( 1 ) ) ) )
290
292
. subscribe ( ( info ) => this . onSourceLoaded ( info ) )
291
293
}
0 commit comments