From 34659973c1ae8b778ca1f87eaa800d5ef51001e8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 8 May 2025 17:06:38 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14729 --- app/src/boot/globalEvent/command/global.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/boot/globalEvent/command/global.ts b/app/src/boot/globalEvent/command/global.ts index 44b9db954..5c3a4d8df 100644 --- a/app/src/boot/globalEvent/command/global.ts +++ b/app/src/boot/globalEvent/command/global.ts @@ -274,11 +274,22 @@ export const globalCommand = (command: string, app: App) => { } return true; } - const tab = getActiveTab(false); + + const tab = getActiveTab(); if (tab) { tab.parent.removeTab(tab.id); + return true; + } + // https://github.com/siyuan-note/siyuan/issues/14729 + if (window.siyuan.blockPanels.length > 0) { + window.siyuan.blockPanels[window.siyuan.blockPanels.length - 1]?.destroy(); + return true; + } + const noFocusTab = getActiveTab(false); + if (noFocusTab) { + noFocusTab.parent.removeTab(noFocusTab.id); + return true; } - return true; } if (command === "closeOthers" || command === "closeAll") { const tab = getActiveTab(false);