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/11981

Vanessab9adce4e9286
diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts
index cb1f97bd8b..61a329c634 100644
--- a/app/src/editor/util.ts
+++ b/app/src/editor/util.ts
@@ -163,7 +163,10 @@ export const openFile = async (options: IOpenFileOptions) => {
if (hasClosestByClassName(item.element, "layout__wnd--active")) {
activeEditor = item;
}
- editor = item;
+ if (!editor || item.headElement.getAttribute("data-activetime") > editor.headElement.getAttribute("data-activetime")) {
+ // https://github.com/siyuan-note/siyuan/issues/11981#issuecomment-2351939812
+ editor = item;
+ }
}
if (activeEditor) {
return true;