Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8146: Fixes Tab Selection and mode switching (#8147)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T authored and iccub committed Sep 25, 2023
1 parent 825a7a3 commit 6b03a95
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,12 @@ class TabTrayController: AuthenticationController {
tabManager.addTabAndSelect(isPrivate: true)
}

let privateModeTabSelected = tabManager.allTabs[safe: tabManager.privateTabSelectedIndex]
let privateModeTabSelected = tabManager.tabsForCurrentMode[safe: tabManager.privateTabSelectedIndex] ?? tabManager.tabsForCurrentMode.last

if Preferences.Privacy.persistentPrivateBrowsing.value {
tabManager.selectTab(privateModeTabSelected)
}

tabTrayView.hidePrivateModeInfo()
tabTrayView.collectionView.reloadData()

Expand All @@ -668,8 +669,8 @@ class TabTrayController: AuthenticationController {

// When you go back from private mode, a previous current tab is selected
// Reloding the collection view in order to mark the selecte the tab
let normalModeTabSelected = tabManager.allTabs[safe: tabManager.normalTabSelectedIndex]
let normalModeTabSelected = tabManager.tabsForCurrentMode[safe: tabManager.normalTabSelectedIndex] ?? tabManager.tabsForCurrentMode.last

tabManager.selectTab(normalModeTabSelected)
tabTrayView.collectionView.reloadData()

Expand Down

0 comments on commit 6b03a95

Please sign in to comment.