From b3dd8791db719a9aa51fbbf46a73728fe195ab47 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 4 Oct 2025 16:01:28 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20https://github.com/siyuan-note/siyuan/i?= =?UTF-8?q?ssues/15989=20=E6=8B=96=E6=8B=BD=E5=88=B0=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=8B=E9=9C=80=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/util/editorCommonEvent.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index ace6486fb..ca18cff70 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -148,8 +148,10 @@ const moveToNew = (protyle: IProtyle, sourceElements: Element[], targetElement: action: "delete", id: newSourceId, }); - doOperations.push(...foldData.doOperations); - undoOperations.push(...foldData.undoOperations); + if (foldData) { + doOperations.push(...foldData.doOperations); + undoOperations.push(...foldData.undoOperations); + } return { doOperations, undoOperations, @@ -255,8 +257,10 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen doOperations.push(...responseTransaction.data.doOperations); undoOperations.push(...responseTransaction.data.undoOperations); } - doOperations.push(...foldData.doOperations); - undoOperations.push(...foldData.undoOperations); + if (foldData) { + doOperations.push(...foldData.doOperations); + undoOperations.push(...foldData.undoOperations); + } return { doOperations, undoOperations,