From 358bcaf0218c624e22d4eac4d7aba9e6efd1cc86 Mon Sep 17 00:00:00 2001 From: mbnuqw Date: Tue, 15 Aug 2023 11:44:31 +0500 Subject: [PATCH] Fixed: onTabMoved: Update native tabs visibility if needed --- src/services/tabs.fg.handlers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/services/tabs.fg.handlers.ts b/src/services/tabs.fg.handlers.ts index 16edd5cc..03b3f9b7 100644 --- a/src/services/tabs.fg.handlers.ts +++ b/src/services/tabs.fg.handlers.ts @@ -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) } @@ -1196,6 +1203,7 @@ 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() @@ -1203,6 +1211,8 @@ function onTabMoved(id: ID, info: browser.tabs.MoveInfo): void { // Update succession if (!mvLen) Tabs.updateSuccessionDebounced(0) + + if (nativeTabsVisibilityUpdateNeeded) Tabs.updateNativeTabsVisibility() } /**