Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 41f76f7

Browse files
committed
Fix static methods were not passed the cachePruneTriggerLimit or fileDirName
1 parent 51df311 commit 41f76f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/imageCacheHoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function imageCacheHoc(Image, options = {}) {
6969
* @returns {Promise} promise that resolves to an object that contains cached file info.
7070
*/
7171
static async cacheFile(url, permanent = false) {
72-
const fileSystem = FileSystemFactory();
72+
const fileSystem = FileSystemFactory(options.cachePruneTriggerLimit, options.fileDirName);
7373
const localFilePath = await fileSystem.getLocalFilePathFromUrl(url, permanent);
7474

7575
return {
@@ -87,7 +87,7 @@ export default function imageCacheHoc(Image, options = {}) {
8787
* @returns {Promise} promise that resolves to an object that contains the flush results.
8888
*/
8989
static async flush() {
90-
const fileSystem = FileSystemFactory();
90+
const fileSystem = FileSystemFactory(options.cachePruneTriggerLimit, options.fileDirName);
9191
const results = await Promise.all([
9292
fileSystem.unlink('permanent'),
9393
fileSystem.unlink('cache'),

0 commit comments

Comments
 (0)