Skip to content

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

:lipstick: fix https://github.com/siyuan-note/siyuan/issues/11092

Vanessaa2ffb2a21c8c
diff --git a/app/src/layout/dock/Backlink.ts b/app/src/layout/dock/Backlink.ts
index 53232bc346..0bbae16219 100644
--- a/app/src/layout/dock/Backlink.ts
+++ b/app/src/layout/dock/Backlink.ts
@@ -466,6 +466,9 @@ export class Backlink extends Model {
if (!this.blockId) {
return;
}
+ this.editors.forEach(item => {
+ item.destroy();
+ })
const element = this.element.querySelector('.block__icon[data-type="refresh"] svg');
element.classList.add("fn__rotate");
fetchPost("/api/ref/refreshBacklink", {
diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts
index 632362e1af..a6772a84c6 100644
--- a/app/src/protyle/util/reload.ts
+++ b/app/src/protyle/util/reload.ts
@@ -31,7 +31,7 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
const isMention = protyle.element.getAttribute("data-ismention") === "true";
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
if (tabElement) {
- const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>;
+ const inputsElement = tabElement.querySelectorAll(".b3-text-field") as NodeListOf<HTMLInputElement>;
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
defID: protyle.element.getAttribute("data-defid"),
refTreeID: protyle.block.rootID,
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 7994fc931c..2bb908de76 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -738,7 +738,10 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
return;
}
if (operation.action === "append") {
- reloadProtyle(protyle, false);
+ // 目前只有移动块的时候会调用,反连面板就自己点击刷新处理。
+ if (!protyle.options.backlinkData) {
+ reloadProtyle(protyle, false);
+ }
return;
}
if (["addAttrViewCol", "insertAttrViewBlock", "updateAttrViewCol", "updateAttrViewColOptions",