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

Fix #8146: Fixes Tab Selection and mode switching #8147

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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