Skip to content

Commit 461eed5

Browse files
authored
fix(cache): Fix race condition with cancel()
1 parent 409a06f commit 461eed5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ export class ImageCache {
9191
cache.downloading = false;
9292
cache.path = path;
9393
this.notify(uri);
94-
}).catch(() => cache.downloading = false);
94+
}).catch(() => {
95+
cache.downloading = false
96+
// Because of this bug: https://github.com/wkh237/react-native-fetch-blob/issues/331
97+
RNFetchBlob.fs.unlink(path);
98+
});
9599
}
96100
}
97101

0 commit comments

Comments
 (0)