From 4acc006b13359b4598e570d626df46f0f6571cca Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 3 Feb 2023 22:33:22 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/4494 --- app/src/util/newFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index 38b8f794a..6020150c3 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -89,7 +89,7 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin } const id = Lute.NewNodeID(); const newPath = pathPosix().join(getDisplayName(currentPath, false, true), id + ".sy"); - if (paths.length > 0) { + if (paths) { paths[paths.indexOf(undefined)] = newPath; } fetchPost("/api/filetree/createDoc", {