From 70809eb637c26cf5247e2addd837ccf69173c2f8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 16 Aug 2024 11:55:30 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12196 --- app/src/layout/util.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index bb814e41d..8f582e136 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -313,6 +313,11 @@ export const JSONToCenter = ( ) => { let child: Layout | Wnd | Tab | Model; if (json.instance === "Layout") { + // TabA 向右分屏后向下分屏,依次关闭右侧、上侧分屏无法移除 layout 嵌套,故在此解决 https://github.com/siyuan-note/siyuan/issues/12196 + while (json.children.length === 1 && json.children[0].instance === "Layout" && + json.children[0].type === "normal" && json.children[0].children.length === 1) { + json.children = json.children[0].children; + } if (!layout) { window.siyuan.layout.layout = new Layout({ element: document.getElementById("layouts"),