From de451d5512959b0ebd678a13d14bc8e47ad46c89 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 10 Mar 2025 10:01:48 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14327 --- app/src/editor/util.ts | 2 +- app/src/mobile/util/MobileBackFoward.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index f87d3bceb..45d7e7ac4 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -382,7 +382,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IMod } else { // 点击大纲产生滚动时会动态加载内容,最终导致定位不准确 preventScroll(editor.editor.protyle); - editor.editor.protyle.observerLoad.disconnect(); + editor.editor.protyle.observerLoad?.disconnect(); if (options.action?.includes(Constants.CB_GET_HL)) { highlightById(editor.editor.protyle, options.id, true); } else if (options.action?.includes(Constants.CB_GET_FOCUS)) { diff --git a/app/src/mobile/util/MobileBackFoward.ts b/app/src/mobile/util/MobileBackFoward.ts index 4bdf95da3..ed0a4e9a0 100644 --- a/app/src/mobile/util/MobileBackFoward.ts +++ b/app/src/mobile/util/MobileBackFoward.ts @@ -19,7 +19,7 @@ const forwardStack: IBackStack[] = []; const focusStack = (backStack: IBackStack) => { const protyle = getCurrentEditor().protyle; // 前进后快速后退会导致滚动错位 https://ld246.com/article/1734018624070 - protyle.observerLoad.disconnect(); + protyle.observerLoad?.disconnect(); window.siyuan.storage[Constants.LOCAL_DOCINFO] = { id: backStack.id,