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/issues/15487

Vanessaa76c29f5c9d9
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 3cfc53a097..07a351e2c2 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -659,14 +659,16 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
if (operation.action === "foldAttrViewGroup") {
Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {
const foldElement = item.querySelector(`[data-type="av-group-fold"][data-id="${operation.id}"]`);
- if (operation.data) {
- foldElement.firstElementChild.classList.remove("av__group-arrow--open");
- foldElement.parentElement.nextElementSibling.classList.add("fn__none");
- } else {
- foldElement.firstElementChild.classList.add("av__group-arrow--open");
- foldElement.parentElement.nextElementSibling.classList.remove("fn__none");
+ if (foldElement) {
+ if (operation.data) {
+ foldElement.firstElementChild.classList.remove("av__group-arrow--open");
+ foldElement.parentElement.nextElementSibling.classList.add("fn__none");
+ } else {
+ foldElement.firstElementChild.classList.add("av__group-arrow--open");
+ foldElement.parentElement.nextElementSibling.classList.remove("fn__none");
+ }
+ foldElement.removeAttribute("data-folding");
}
- foldElement.removeAttribute("data-folding");
});
return;
}