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

Commit 6070bc3

Browse files
committed
fix: RNFS.touch fails if mtime or ctime are not set
1 parent 28e67f0 commit 6070bc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FileSystem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export class FileSystem {
258258
await (move ? RNFS.moveFile(local, path) : RNFS.copyFile(local, path))
259259

260260
// Update the modified and created times of the file otherwise the if-modified-since request will probably always
261-
await RNFS.touch(path, mtime, ctime)
261+
await RNFS.touch(path, mtime ?? new Date(), ctime ?? new Date())
262262
} catch (error) {
263263
await RNFSUnlinkIfExists(path)
264264
return {

0 commit comments

Comments
 (0)