Skip to content

Commit

Permalink
correctly fire autoclear pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Dec 12, 2024
1 parent f5c17a6 commit beebf95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion DuckDuckGo/AutoClearSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ class AutoClearSettingsViewController: UITableViewController {

decorate()
}


override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
Pixel.fire(pixel: .settingsDataClearingClearDataOpen)
}

private func loadClearDataSettings() -> AutoClearSettingsModel? {
return AutoClearSettingsModel(settings: appSettings)
}
Expand Down Expand Up @@ -152,6 +157,8 @@ class AutoClearSettingsViewController: UITableViewController {
}

@IBAction func onClearDataToggled(_ sender: UISwitch) {
Pixel.fire(pixel: sender.isOn ? .settingsAutomaticallyClearDataOn : .settingsAutomaticallyClearDataOff)

if sender.isOn {
clearDataSettings = AutoClearSettingsModel()
tableView.insertSections(.init(integersIn: Sections.action.rawValue...Sections.timing.rawValue), with: .fade)
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/SettingsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ extension SettingsViewModel {
queue: .main) { [weak self] _ in
guard let settings = self?.appSettings else { return }
self?.state.autoclearDataEnabled = (AutoClearSettingsModel(settings: settings) != nil)
Pixel.fire(pixel: self?.state.autoclearDataEnabled == true ? .settingsAutomaticallyClearDataOn : .settingsAutomaticallyClearDataOff)
}

textZoomObserver = NotificationCenter.default.addObserver(forName: AppUserDefaults.Notifications.textZoomChange,
Expand Down

0 comments on commit beebf95

Please sign in to comment.