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

Vanessa5a69b30883c0
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index b3bc322844..b93a2d559e 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -371,7 +371,12 @@ export class Wnd {
/// #if !BROWSER
if (!oldTab) { // 从主窗口拖拽到页签新窗口
JSONToCenter(app, tabData, this);
- oldTab = this.children[this.children.length - 1];
+ this.children.find(item => {
+ if (item.headElement.getAttribute("data-activeTime") === tabData.activeTime) {
+ oldTab = item;
+ return true;
+ }
+ });
ipcRenderer.send(Constants.SIYUAN_SEND_WINDOWS, {cmd: "closetab", data: tabData.id});
ipcRenderer.send(Constants.SIYUAN_CMD, "focus");
}