Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/6648

Vanessa44d149d39236
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 10edc840f6..aaec9083ba 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -330,6 +330,7 @@ const dragSame = async (protyle: IProtyle, sourceElements: Element[], targetElem
}
}
if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") {
+ item.removeAttribute("fold");
foldHeadingIds.push(id);
const headingIds = await fetchSyncPost("/api/block/getHeadingChildrenIDs", {id})
headingIds.data.reverse().forEach((headingId: string) => {
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 8b54d84ae8..9e928e262e 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -73,14 +73,14 @@ const promiseTransaction = () => {
return;
}
countBlockWord([], protyle.block.rootID, true);
- if (doOperations[0].action === "setAttrs") {
+ if (response.data[0].doOperations[0].action === "setAttrs") {
const gutterFoldElement = protyle.gutter.element.querySelector('[data-type="fold"]');
if (gutterFoldElement) {
gutterFoldElement.removeAttribute("disabled");
}
// 仅在 alt+click 箭头折叠时才会触发
protyle.wysiwyg.element.querySelectorAll('[data-type="NodeBlockQueryEmbed"]').forEach((item) => {
- if (item.querySelector(`[data-node-id="${doOperations[0].id}"]`)) {
+ if (item.querySelector(`[data-node-id="${response.data[0].doOperations[0].id}"]`)) {
item.removeAttribute("data-render");
blockRender(protyle, item);
}
@@ -92,7 +92,7 @@ const promiseTransaction = () => {
if (getSelection().rangeCount > 0) {
range = getSelection().getRangeAt(0);
}
- doOperations.forEach(operation => {
+ response.data[0].doOperations.forEach((operation: IOperation) => {
if (operation.action === "unfoldHeading" || operation.action === "foldHeading") {
const gutterFoldElement = protyle.gutter.element.querySelector('[data-type="fold"]');
if (gutterFoldElement) {