Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/13343

Vanessa70d024666897
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 391c639fb0..60a18e9406 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -1200,7 +1200,7 @@ const renderNextSearchMark = (options: {
}
};
-let reqId: number
+let articleId: string
export const getArticle = (options: {
id: string,
@@ -1208,14 +1208,20 @@ export const getArticle = (options: {
edit: Protyle
value?: string,
}) => {
+ articleId = options.id
checkFold(options.id, (zoomIn) => {
+ if (articleId !== options.id) {
+ return;
+ }
options.edit.protyle.scroll.lastScrollTop = 0;
addLoading(options.edit.protyle);
fetchPost("/api/block/getDocInfo", {
id: options.id,
}, (response) => {
+ if (articleId !== options.id) {
+ return;
+ }
options.edit.protyle.wysiwyg.renderCustom(response.data.ial);
- reqId = new Date().getTime()
fetchPost("/api/filetree/getDoc", {
id: options.id,
query: options.value || null,
@@ -1225,9 +1231,8 @@ export const getArticle = (options: {
size: zoomIn ? Constants.SIZE_GET_MAX : window.siyuan.config.editor.dynamicLoadBlocks,
zoom: zoomIn,
highlight: !isSupportCSSHL(),
- reqId
}, getResponse => {
- if (reqId > response.data.reqId) {
+ if (articleId !== options.id) {
return;
}
options.edit.protyle.query = {