From 8f15b0f4acc8d83ea5e113b848ea428e7193cc11 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 26 Oct 2023 23:49:16 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9522 --- app/src/util/newFile.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index 72c4a43da..072c83498 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -52,13 +52,18 @@ export const getNewFilePath = (useSavePath: boolean) => { } /// #endif if (!notebookId) { - window.siyuan.notebooks.find(item => { - if (!item.closed) { - notebookId = item.id; - currentPath = "/"; - return true; - } - }); + if (window.siyuan.mobile.editor) { + notebookId = window.siyuan.mobile.editor.protyle.notebookId; + } + if (!notebookId) { + window.siyuan.notebooks.find(item => { + if (!item.closed) { + notebookId = item.id; + currentPath = "/"; + return true; + } + }); + } } return {notebookId, currentPath}; };