From 9a97b006d464e5b94ac5fd816d9cf4b0036378bc Mon Sep 17 00:00:00 2001 From: mbnuqw Date: Sun, 29 Dec 2024 21:12:49 +0500 Subject: [PATCH] fix: preserve custom color/title on auto-reopening tab in dif container --- src/services/tabs.fg.handlers.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/tabs.fg.handlers.ts b/src/services/tabs.fg.handlers.ts index 657c0a2f..031ae2ff 100644 --- a/src/services/tabs.fg.handlers.ts +++ b/src/services/tabs.fg.handlers.ts @@ -298,6 +298,12 @@ function onTabCreated(nativeTab: NativeTab, attached?: boolean): void { const oldTab = Tabs.list[tab.index] if (oldTab?.reopening) { oldTab.reopening.id = tab.id + + // Restore some props + tab.customColor = oldTab.customColor + tab.reactive.customColor = oldTab.customColor ?? null + tab.customTitle = oldTab.customTitle + tab.reactive.customTitle = oldTab.customTitle ?? null } } @@ -1068,7 +1074,6 @@ function onTabRemoved(tabId: ID, info: browser.tabs.RemoveInfo, detached?: boole newTab.reactive.folded = tab.folded newTab.isParent = tab.isParent newTab.reactive.isParent = tab.isParent - // TODO: custom title/color Tabs.forEachDescendant(tab, t => { if (t.parentId === tab.id) { t.parentId = newTab.id