From 41b14025b4ac4a8379d1200580344ca18ad152b7 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 2 Oct 2025 18:02:13 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/15969 --- app/src/card/openCard.ts | 4 +--- app/src/card/viewCards.ts | 6 +----- app/src/protyle/header/Title.ts | 2 +- app/src/protyle/util/onGet.ts | 11 ----------- app/src/search/util.ts | 2 +- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index 37f1a7b47..1119edd94 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -161,10 +161,8 @@ const getEditor = (id: string, protyle: IProtyle, element: Element, currentCard: updateReadonly: true, data: response, protyle, - action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML], + action: response.data.rootID === response.data.id ? [] : [Constants.CB_GET_ALL], afterCB: () => { - protyle.title.element.removeAttribute("data-render"); - protyle.title.render(protyle, docResponse); let hasHide = false; if (!window.siyuan.config.flashcard.superBlock && !window.siyuan.config.flashcard.heading && diff --git a/app/src/card/viewCards.ts b/app/src/card/viewCards.ts index 100114080..bdba0ac24 100644 --- a/app/src/card/viewCards.ts +++ b/app/src/card/viewCards.ts @@ -313,11 +313,7 @@ const getArticle = (edit: Protyle, id: string) => { updateReadonly: true, data: getResponse, protyle: edit.protyle, - action: getResponse.data.rootID === getResponse.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML], - afterCB() { - edit.protyle.title.element.removeAttribute("data-render"); - edit.protyle.title.render(edit.protyle, response); - } + action: getResponse.data.rootID === getResponse.data.id ? [] : [Constants.CB_GET_ALL], }); }); }); diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index 533d05030..d4e7e0dc0 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -351,7 +351,7 @@ export class Title { } public render(protyle: IProtyle, response: IWebSocketData) { - if (this.element.getAttribute("data-render") === "true") { + if (this.element.getAttribute("data-render") === "true" && this.element.dataset.nodeId === protyle.block.rootID) { return false; } if (protyle.options.render.hideTitleOnZoom) { diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 9528eb0f4..beedd4fe5 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -91,17 +91,6 @@ export const onGet = (options: { isSyncing: options.data.data.isSyncing, afterCB: options.afterCB, }, options.protyle); - - // 如果需要渲染标题且包含 CB_GET_HTML,需要获取文档信息来更新标题 - if (options.protyle.options.render.title && options.action.includes(Constants.CB_GET_HTML)) { - fetchPost("/api/block/getDocInfo", { - id: options.protyle.block.rootID - }, (response) => { - options.protyle.title.element.removeAttribute("data-render"); - options.protyle.title.render(options.protyle, response); - }); - } - removeLoading(options.protyle); return; } diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 664d9ee30..3ad4a6829 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -1118,7 +1118,7 @@ export const getArticle = (options: { updateReadonly: true, data: getResponse, protyle: options.edit.protyle, - action: zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HTML], + action: zoomIn ? [Constants.CB_GET_ALL] : [], }); const contentRect = options.edit.protyle.contentElement.getBoundingClientRect();