Skip to content

Commit

Permalink
Fix brave/brave-ios#8146: Fixes Tab Selection and mode switching (br…
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T authored Sep 25, 2023
1 parent b9372f5 commit 0b635e7
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 0b635e7

Please sign in to comment.