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 Sep 25, 2023
1 parent 37e31a6 commit 4d8530d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,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 @@ -691,8 +692,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 4d8530d

Please sign in to comment.