From 0df6fc6a630da488ab0e3ce6ab1f57702c6f2ab0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 29 Oct 2023 17:15:44 +0800 Subject: [PATCH] :bug: new file --- app/src/util/newFile.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index 072c83498..a45a9e060 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -50,20 +50,19 @@ export const getNewFilePath = (useSavePath: boolean) => { } } } + /// #else + if (window.siyuan.mobile.editor) { + notebookId = window.siyuan.mobile.editor.protyle.notebookId; + } /// #endif if (!notebookId) { - 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; - } - }); - } + window.siyuan.notebooks.find(item => { + if (!item.closed) { + notebookId = item.id; + currentPath = "/"; + return true; + } + }); } return {notebookId, currentPath}; };