Skip to content

Commit

Permalink
fix(antitracker): update listUpdated in AntiTrackerViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajhilje committed Nov 9, 2023
1 parent fa465cd commit 663c397
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ class AntiTrackerViewController: UITableViewController {

@IBAction func toggleAntiTrackerHardcore(_ sender: UISwitch) {
UserDefaults.shared.set(sender.isOn, forKey: UserDefaults.Key.isAntiTrackerHardcore)
evaluateReconnect(sender: sender as UIView)
NotificationCenter.default.post(name: Notification.Name.UpdateControlPanel, object: nil)
if UserDefaults.shared.isAntiTracker {
evaluateReconnect(sender: sender as UIView)
}
}

// MARK: - View Lifecycle -
Expand Down Expand Up @@ -96,7 +98,9 @@ class AntiTrackerViewController: UITableViewController {
}

@objc private func listUpdated() {
evaluateReconnect(sender: antiTrackerList)
if UserDefaults.shared.isAntiTracker {
evaluateReconnect(sender: antiTrackerList)
}
}

}
Expand Down

0 comments on commit 663c397

Please sign in to comment.