Skip to content

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

:art: 数据库镜像更新标题

Vanessacd29a9a3136f
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index e0e051d5d7..6dfb7afd3e 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -370,6 +370,20 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
blockElement.setAttribute("updated", newUpdated);
nameElement.dataset.title = newData;
blockElement.querySelector(".layout-tab-bar .item__text").textContent = newData;
+
+ // 当前页面不能进行推送,否则光标会乱跳
+ Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => {
+ if(blockElement.isSameNode(item)) {
+ return;
+ }
+ const titleElement = item.querySelector(".av__title") as HTMLElement;
+ if (!titleElement) {
+ return;
+ }
+ titleElement.textContent = newData;
+ titleElement.dataset.title = newData;
+ item.querySelector(".layout-tab-bar .item__text").textContent = newData;
+ });
};
export const updateAttrViewCellAnimation = (cellElement: HTMLElement) => {