Skip to content

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

:art: https://github.com/siyuan-note/siyuan/pull/17651

Vanessafc87678674d5
diff --git a/app/src/protyle/util/blockFold.ts b/app/src/protyle/util/blockFold.ts
index a269f8b21f..e7b8382880 100644
--- a/app/src/protyle/util/blockFold.ts
+++ b/app/src/protyle/util/blockFold.ts
@@ -162,10 +162,6 @@ export const foldBlocksRecursively = (protyle: IProtyle, nodeElements: Element[]
return 0;
});
- if (elementsToFold.length === 0) {
- return;
- }
-
elementsToFold.forEach(element => {
const hasFold = element.getAttribute("fold") === "1";
if (isFoldAll && hasFold) {
@@ -184,7 +180,7 @@ export const foldBlocksRecursively = (protyle: IProtyle, nodeElements: Element[]
if (doOperations.length > 0) {
transaction(protyle, doOperations, undoOperations);
preventScroll(protyle);
- scrollCenter(protyle, elementsToFold[0]);
+ scrollCenter(protyle, isFoldAll ? elementsToFold[elementsToFold.length - 1] : elementsToFold[0]);
}
};