From 305c24706961fb8a813863fd5e18cb48f48d4387 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 29 Jan 2026 23:05:22 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/16879 --- app/src/layout/Wnd.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index c5f0885f0..5260996df 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -787,10 +787,12 @@ export class Wnd { if (window.siyuan.storage[Constants.LOCAL_CLOSED_TABS].length > Constants.SIZE_UNDO) { window.siyuan.storage[Constants.LOCAL_CLOSED_TABS].pop(); } - const tabJSON = {}; - layoutToJSON(item, tabJSON); - window.siyuan.storage[Constants.LOCAL_CLOSED_TABS].push(tabJSON); - setStorageVal(Constants.LOCAL_CLOSED_TABS, window.siyuan.storage[Constants.LOCAL_CLOSED_TABS]); + if (item.headElement) { + const tabJSON = {}; + layoutToJSON(item, tabJSON); + window.siyuan.storage[Constants.LOCAL_CLOSED_TABS].push(tabJSON); + setStorageVal(Constants.LOCAL_CLOSED_TABS, window.siyuan.storage[Constants.LOCAL_CLOSED_TABS]); + } if (item.model instanceof Custom && item.model.beforeDestroy) { item.model.beforeDestroy(); }