fix(explorer): refresh file list if newly created file is a nested path (cloudreve/cloudreve#2853)

This commit is contained in:
Aaron Liu 2025-08-31 10:33:42 +08:00
parent 35961604a1
commit 64b34b280f

View File

@ -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 }));