diff --git a/Client/Frontend/Browser/BrowserViewController.swift b/Client/Frontend/Browser/BrowserViewController.swift index 1a318d5d1f2..02fb4d9d106 100644 --- a/Client/Frontend/Browser/BrowserViewController.swift +++ b/Client/Frontend/Browser/BrowserViewController.swift @@ -3074,24 +3074,8 @@ extension BrowserViewController: PreferencesObserver { setupTabs() updateTabsBarVisibility() updateApplicationShortcuts() - tabManager.removeAll() - - // Clear all persistent data - let clearables: [Clearable] = [ - HistoryClearable(), - CacheClearable(), - CookiesAndCacheClearable(), - PasswordsClearable(profile: self.profile) - ] - - // Reset tab manager configuration tabManager.resetConfiguration() - ClearPrivateDataTableViewController.clearPrivateData(clearables).uponQueue(DispatchQueue.main) { _ in - - // Clear saved tab data - TabMO.deleteAll() - } case Preferences.Shields.blockAdsAndTracking.key, Preferences.Shields.httpsEverywhere.key, Preferences.Shields.blockScripts.key, diff --git a/Client/Frontend/Settings/SettingsViewController.swift b/Client/Frontend/Settings/SettingsViewController.swift index db3bc92c8f3..b9f8f30a563 100644 --- a/Client/Frontend/Settings/SettingsViewController.swift +++ b/Client/Frontend/Settings/SettingsViewController.swift @@ -273,6 +273,16 @@ class SettingsViewController: TableViewController { alert.addAction(UIAlertAction(title: Strings.OKString, style: .default, handler: { _ in Preferences.Privacy.privateBrowsingOnly.value = value + + let clearables: [Clearable] = [ + HistoryClearable(), + CacheClearable(), + CookiesAndCacheClearable(), + PasswordsClearable(profile: self.profile) + ] + ClearPrivateDataTableViewController.clearPrivateData(clearables).uponQueue(DispatchQueue.main) { _ in + TabMO.deleteAll() + } })) self.present(alert, animated: true, completion: nil)