Skip to content

Commit

Permalink
Fixed: onTabMoved: Update native tabs visibility if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Aug 15, 2023
1 parent 48fd5af commit 358bcaf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/services/tabs.fg.handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,10 +1182,17 @@ function onTabMoved(id: ID, info: browser.tabs.MoveInfo): void {

Sidebar.recalcTabsPanels()

let nativeTabsVisibilityUpdateNeeded = false

// Calc tree levels and colorize branch
if (Settings.state.tabsTree) {
const toTabFolded = toTab.folded
if (!mvLen) Tabs.updateTabsTree()

if (toTabFolded !== toTab.folded && Settings.state.hideFoldedTabs) {
nativeTabsVisibilityUpdateNeeded = true
}

if (Settings.state.colorizeTabsBranches && tab.lvl > 0) {
Tabs.setBranchColor(tab.id)
}
Expand All @@ -1196,13 +1203,16 @@ function onTabMoved(id: ID, info: browser.tabs.MoveInfo): void {

if (movedTab.panelId !== Sidebar.activePanelId && movedTab.active) {
Sidebar.activatePanel(movedTab.panelId)
if (Settings.state.hideInact) nativeTabsVisibilityUpdateNeeded = true
}

if (!mvLen) Tabs.cacheTabsData()
Tabs.saveTabData(movedTab.id)

// Update succession
if (!mvLen) Tabs.updateSuccessionDebounced(0)

if (nativeTabsVisibilityUpdateNeeded) Tabs.updateNativeTabsVisibility()
}

/**
Expand Down

0 comments on commit 358bcaf

Please sign in to comment.