From 64b34b280f6bef04fb90fecdf3c321c30e8e4ac4 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Sun, 31 Aug 2025 10:33:42 +0800 Subject: [PATCH] fix(explorer): refresh file list if newly created file is a nested path (cloudreve/cloudreve#2853) --- src/redux/thunks/file.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/redux/thunks/file.ts b/src/redux/thunks/file.ts index 7e204a7..7930f31 100644 --- a/src/redux/thunks/file.ts +++ b/src/redux/thunks/file.ts @@ -1030,6 +1030,12 @@ export function submitCreateNew(index: number, name: string, type: number): AppT }), ); + // if name does not contain "/", append cache + if (name.includes("/")) { + dispatch(refreshFileList(index)); + return newFile; + } + const newList = fm.list?.files ? [...fm.list.files, newFile] : [newFile]; if (newList) { dispatch(setFileList({ index: FileManagerIndex.main, value: newList }));