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

Commit

Permalink
Fix private-tab mode message not showing all the time.
Browse files Browse the repository at this point in the history
Fix private tab deleting when exiting persistence mode.
  • Loading branch information
Brandon-T committed Jun 19, 2023
1 parent 2c5e7bb commit 1e75e0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ class TabTrayController: LoadingViewController {
tabTypeSelector.selectedSegmentIndex = 0
tabTypeSelector.sendActions(for: UIControl.Event.valueChanged)

if !Preferences.Privacy.persistentPrivateBrowsing.value {
if !Preferences.Privacy.persistentPrivateBrowsing.value || tabManager.tabsForCurrentMode.isEmpty {
tabTrayView.showPrivateModeInfo()
// New private tab is created immediately to reflect changes on NTP.
// If user drags the modal down or dismisses it, a new private tab will be ready.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ struct OtherPrivacySettingsSectionView: View {
settings.tabManager.saveAllTabs()
} else {
let tabs = settings.tabManager.allTabs.filter({ $0.isPrivate })
if settings.tabManager.privateBrowsingManager.isPrivateBrowsing {
SessionTab.deleteAll(tabIds: tabs.map({ $0.id }))
} else {
settings.tabManager.removeTabs(tabs)
SessionTab.deleteAll(tabIds: tabs.map({ $0.id }))

if !settings.tabManager.privateBrowsingManager.isPrivateBrowsing {
settings.tabManager.willSwitchTabMode(leavingPBM: true)
}
}
}
Expand Down

0 comments on commit 1e75e0f

Please sign in to comment.