Skip to content

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

:bug: Clear database virtual row selection reliably

Danielc047b656b829
diff --git a/app/src/protyle/util/clear.ts b/app/src/protyle/util/clear.ts
index b7e2476b81..a8802df218 100644
--- a/app/src/protyle/util/clear.ts
+++ b/app/src/protyle/util/clear.ts
@@ -1,4 +1,4 @@
-import {updateHeader} from "../render/av/row";
+import {updateAVSelectionStatus, updateHeader} from "../render/av/row";
import {resetAVRowSelect} from "../render/av/virtualScroll";
import {hasClosestByClassName} from "./hasClosest";
import {Constants} from "../../constants";
@@ -122,13 +122,12 @@ const resetAVBodySelect = (element: Element, type: "table" | "gallery" | "all")
return;
}
avElement.querySelectorAll(".av__body").forEach((bodyElement: HTMLElement) => {
+ if (hasClosestByClassName(bodyElement, "av") !== avElement) {
+ return;
+ }
resetAVRowSelect(bodyElement, []);
});
- const itemElement = avElement.querySelector(
- ".av__row:not(.av__row--header):not(.av__row--footer):not(.av__row--util), .av__gallery-item") as HTMLElement;
- if (itemElement) {
- updateHeader(itemElement);
- }
+ updateAVSelectionStatus(avElement);
});
};