Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/10155

Vanessa9cd74597ac86
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 1d0b436da9..2341b9c8b7 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -198,7 +198,7 @@ const setHTML = (options: {
protyle.breadcrumb.element.nextElementSibling.textContent = "";
}
protyle.element.removeAttribute("disabled-forever");
- setReadonlyByConfig(protyle);
+ setReadonlyByConfig(protyle, options.action);
}
focusElementById(protyle, options.action, options.scrollAttr);
@@ -431,9 +431,11 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
}
};
-export const setReadonlyByConfig = (protyle: IProtyle) => {
+export const setReadonlyByConfig = (protyle: IProtyle, action: string[]) => {
let readOnly = window.siyuan.config.readonly ? "true" : "false";
- if (readOnly === "false") {
+ if (action?.includes(Constants.CB_GET_UNCHANGEID)) {
+ readOnly = protyle.disabled ? "true" : "false";
+ } else if (readOnly === "false") {
readOnly = window.siyuan.config.editor.readOnly ? "true" : "false";
if (readOnly === "false") {
readOnly = protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_READONLY);