Skip to content

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

:bug: Fix getActiveEditor function returning inactive editor (#16679)

Jeffrey Chen25b6b9f679fa
diff --git a/app/src/plugin/API.ts b/app/src/plugin/API.ts
index a2af87e018..c6ca16f435 100644
--- a/app/src/plugin/API.ts
+++ b/app/src/plugin/API.ts
@@ -229,7 +229,7 @@ const getActiveEditor = (wndActive = true) => {
}
if (!editor) {
editor = allEditor.find(item => {
- if (hasClosestByClassName(item.protyle.element, "layout__wnd--active", true)) {
+ if (!item.protyle.element.classList.contains("fn__none") && hasClosestByClassName(item.protyle.element, "layout__wnd--active", true)) {
return true;
}
});