Skip to content

Commit

Permalink
Don't try to collapse/expand tree on a non-parent tab #3570
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 7, 2024
1 parent 1793faa commit 431fb8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webextensions/background/handle-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,14 @@ async function isSidebarRightSide(windowId) {
}

function collapseOrFocusToParent(activeTab) {
if (!activeTab.$TST.subtreeCollapsed)
if (!activeTab.$TST.subtreeCollapsed && activeTab.$TST.hasChild)
Commands.collapseTree(activeTab);
else
TabsInternalOperation.activateTab(activeTab.$TST.parent);
}

function expandOrFocusToFirstChild(activeTab) {
if (activeTab.$TST.subtreeCollapsed)
if (activeTab.$TST.subtreeCollapsed && activeTab.$TST.hasChild)
Commands.expandTree(activeTab);
else
TabsInternalOperation.activateTab(activeTab.$TST.firstChild, {
Expand Down

0 comments on commit 431fb8b

Please sign in to comment.