Skip to content

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

:bug: Refresh editor panels when reloading documents https://github.com/siyuan-note/siyuan/issues/18367

Daniel552acf8cd882
diff --git a/app/src/editor/index.ts b/app/src/editor/index.ts
index 34f2c5b254..a3248627df 100644
--- a/app/src/editor/index.ts
+++ b/app/src/editor/index.ts
@@ -154,6 +154,20 @@ export class Editor extends Model {
this.updateBacklinkVisibility();
}
+ public refreshBottomBacklinkPanel() {
+ if (!this.backlink) {
+ return;
+ }
+ const blockId = this.getBacklinkBlockId();
+ const rootId = this.editor.protyle.block.rootID;
+ if (this.backlink.blockId !== blockId || this.backlink.rootId !== rootId) {
+ this.backlink.switchBlock(blockId, rootId, this.editor.protyle.notebookId);
+ return;
+ }
+ this.backlink.markDirty();
+ this.backlink.refreshIfVisible(true);
+ }
+
public destroy() {
this.destroyBacklinkPanel();
this.editor.destroy();
diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts
index b7d31e0310..872f465d57 100644
--- a/app/src/protyle/util/reload.ts
+++ b/app/src/protyle/util/reload.ts
@@ -89,6 +89,8 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?
if (protyle.query?.key) {
searchMarkRender(protyle, keys, protyle.highlight.rangeIndex);
}
+ protyle.databaseAttributePanel?.refresh();
+ protyle.model?.refreshBottomBacklinkPanel();
}
});
}