Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9586

Vanessafb0e5b20cbdb
diff --git a/app/src/menus/tab.ts b/app/src/menus/tab.ts
index 29ce0ddc04..639bafec7a 100644
--- a/app/src/menus/tab.ts
+++ b/app/src/menus/tab.ts
@@ -131,13 +131,23 @@ const splitSubMenu = (app: App, tab: Tab) => {
}
});
}
- const wndsTemp: Wnd[] = [];
- getAllWnds(window.siyuan.layout.layout, wndsTemp);
+ let wndsTemp: Wnd[] = [];
+ getAllWnds(window.siyuan.layout.centerLayout, wndsTemp);
if (wndsTemp.length > 1) {
subMenus.push({
label: window.siyuan.languages.unsplit,
click: () => {
- unsplitWnd(tab.parent.parent.children[0], tab.parent.parent, true);
+ let layout = tab.parent.parent;
+ while (layout.id !== window.siyuan.layout.centerLayout.id) {
+ wndsTemp = [];
+ getAllWnds(layout, wndsTemp);
+ if (wndsTemp.length > 1) {
+ break;
+ } else {
+ layout = layout.parent;
+ }
+ }
+ unsplitWnd(tab.parent.parent.children[0], layout, true);
resizeTabs();
}
});