Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: fix https://github.com/siyuan-note/siyuan/issues/10108

Vanessa339329fb6b96
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index f417322134..1d0b436da9 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -395,6 +395,8 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
if (hasScrollTop) {
protyle.contentElement.scrollTop = scrollAttr.scrollTop;
}
+ // 下一个请求过来前需断开,否则 observerLoad 重新赋值后无法 disconnect https://ld246.com/article/1704612002446
+ protyle.observerLoad?.disconnect();
if (action.includes(Constants.CB_GET_FOCUS) || action.includes(Constants.CB_GET_SCROLL) || action.includes(Constants.CB_GET_HL) || action.includes(Constants.CB_GET_FOCUSFIRST)) {
const contentRect = protyle.contentElement.getBoundingClientRect();
const focusRect = focusElement.getBoundingClientRect();
@@ -402,7 +404,6 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
scrollCenter(protyle, focusElement, true);
}
} else {
- protyle.observerLoad?.disconnect();
return;
}
// 加强定位