From e870babf64a29934fad7bdecce2c2f47ab8e5df0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 28 Aug 2022 23:40:37 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5743 --- app/src/editor/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index 382ed1f3e..1dba2d067 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -132,7 +132,7 @@ const openFile = (options: IOpenFileOptions) => { wnd = getWndByLayout(window.siyuan.layout.centerLayout); } if (wnd) { - if ((options.position === "right" || options.position === "bottom") && wnd.children[0].model) { + if ((options.position === "right" || options.position === "bottom") && wnd.children[0].headElement) { const direction = options.position === "right" ? "lr" : "tb"; let targetWnd: Wnd; if (wnd.parent.children.length > 1 && wnd.parent instanceof Layout && wnd.parent.direction === direction) { @@ -161,7 +161,7 @@ const openFile = (options: IOpenFileOptions) => { } else { wnd.split(direction).addTab(newTab(options)); } - } else if (options.keepCursor && wnd.children[0].model) { + } else if (options.keepCursor && wnd.children[0].headElement) { const tab = newTab(options); tab.headElement.setAttribute("keep-cursor", options.id); wnd.addTab(tab, options.keepCursor);