Skip to content

Commit

Permalink
fix: preserve custom color/title on auto-reopening tab in dif container
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Dec 29, 2024
1 parent d9f1c19 commit 9a97b00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/tabs.fg.handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9a97b00

Please sign in to comment.