An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/11808
Vanessa4f4d41ebb4f3
diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.tsindex 95a9f47c7f..1f07b3ff6c 100644--- a/app/src/dialog/processSystem.ts+++ b/app/src/dialog/processSystem.ts@@ -35,7 +35,14 @@ const updateTitle = (rootID: string, tab: Tab, protyle?: IProtyle) => {});};-export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRootIDs: string[] }, hideMsg = true) => {+export const reloadSync = (+ app: App,+ data: { upsertRootIDs: string[], removeRootIDs: string[] },+ hideMsg = true,+ // 同步的时候需要更新只读状态 https://github.com/siyuan-note/siyuan/issues/11517+ // 调整大纲的时候需要使用现有状态 https://github.com/siyuan-note/siyuan/issues/11808+ updateReadonly = true+) => {if (hideMsg) {hideMessage();}@@ -44,14 +51,14 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRootif (data.removeRootIDs.includes(window.siyuan.mobile.popEditor.protyle.block.rootID)) {hideElements(["dialog"]);} else {- reloadProtyle(window.siyuan.mobile.popEditor.protyle, false);+ reloadProtyle(window.siyuan.mobile.popEditor.protyle, false, updateReadonly);}}if (window.siyuan.mobile.editor) {if (data.removeRootIDs.includes(window.siyuan.mobile.editor.protyle.block.rootID)) {setEmpty(app);} else {- reloadProtyle(window.siyuan.mobile.editor.protyle, false);+ reloadProtyle(window.siyuan.mobile.editor.protyle, false, updateReadonly);fetchPost("/api/block/getDocInfo", {id: window.siyuan.mobile.editor.protyle.block.rootID}, (response) => {@@ -71,7 +78,7 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRootid: item.editor.protyle.block.rootID,}, (response) => {item.editor.protyle.wysiwyg.renderCustom(response.data.ial);- reloadProtyle(item.editor.protyle, false, true);+ reloadProtyle(item.editor.protyle, false, updateReadonly);updateTitle(item.editor.protyle.block.rootID, item.parent, item.editor.protyle);});} else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) {@@ -283,7 +290,7 @@ export const transactionError = () => {});};-export const refreshFileTree = (cb?:() => void) => {+export const refreshFileTree = (cb?: () => void) => {window.siyuan.storage[Constants.LOCAL_FILEPOSITION] = {};setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION]);fetchPost("/api/filetree/refreshFiletree", {}, () => {diff --git a/app/src/index.ts b/app/src/index.tsindex 6e13ded84c..0bcd88cf56 100644--- a/app/src/index.ts+++ b/app/src/index.ts@@ -72,7 +72,7 @@ export class App {reloadSync(this, data.data);break;case "reloaddoc":- reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false);+ reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false);break;case "readonly":window.siyuan.config.editor.readOnly = data.data;diff --git a/app/src/window/index.ts b/app/src/window/index.tsindex c73f24ba8c..24a51a7bcd 100644--- a/app/src/window/index.ts+++ b/app/src/window/index.ts@@ -59,6 +59,9 @@ class App {window.siyuan.emojis = response.data as IEmoji[];});break;+ case "reloaddoc":+ reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false);+ break;case "syncMergeResult":reloadSync(this, data.data);break;