Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/4042

Vanessa929b27b7f6b8
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 8ae074f689..5606a0347e 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -76,6 +76,20 @@ export const onGet = (data: IWebSocketData, protyle: IProtyle, action: string[]
protyle.wysiwyg.element.setAttribute("data-doc-type", data.data.type);
}
+ // 防止动态加载
+ if (action.includes(Constants.CB_GET_APPEND) || action.includes(Constants.CB_GET_BEFORE)) {
+ setHTML({
+ content: html,
+ action,
+ unScroll: false,
+ }, protyle);
+ const loadingElement = protyle.element.querySelector(".fn__loading");
+ if (loadingElement) {
+ loadingElement.remove();
+ }
+ return;
+ }
+
fetchPost("/api/block/getDocInfo", {
id: protyle.block.rootID
}, (response) => {
@@ -91,7 +105,7 @@ export const onGet = (data: IWebSocketData, protyle: IProtyle, action: string[]
if (!scrollObj) {
if (action.includes(Constants.CB_GET_SCROLL) && response.data.ial.scroll) {
try {
- scrollObj = JSON.parse(response.data.ial.scroll)
+ scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"'));
} catch (e) {
scrollObj = undefined;
}