Skip to content

Commit

Permalink
Debug option to clear sent reports
Browse files Browse the repository at this point in the history
  • Loading branch information
amddg44 committed Jul 18, 2024
1 parent d3199d5 commit 6b430e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions DuckDuckGo/AutofillDebugViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import UIKit
import BrowserServicesKit
import Core
import Common
import PrivacyDashboard

class AutofillDebugViewController: UITableViewController {

Expand All @@ -30,6 +31,7 @@ class AutofillDebugViewController: UITableViewController {
case resetDaysSinceInstalledTo0 = 203
case resetAutofillData = 204
case addAutofillData = 205
case resetAutofillBrokenReports = 206
}

let defaults = AppUserDefaults()
Expand Down Expand Up @@ -65,6 +67,12 @@ class AutofillDebugViewController: UITableViewController {
} else if cell.tag == Row.resetDaysSinceInstalledTo0.rawValue {
StatisticsUserDefaults().installDate = Date()
tableView.deselectRow(at: indexPath, animated: true)
} else if cell.tag == Row.resetAutofillBrokenReports.rawValue {
tableView.deselectRow(at: indexPath, animated: true)
let reporter = BrokenSiteReporter(pixelHandler: { _ in }, keyValueStoring: UserDefaults.standard, storageConfiguration: .autofillConfig)
let expiryDate = Calendar.current.date(byAdding: .day, value: 60, to: Date())!
_ = reporter.persistencyManager.removeExpiredItems(currentDate: expiryDate)
ActionMessageView.present(message: "Autofill Broken Reports reset")
}
}
}
Expand Down

0 comments on commit 6b430e1

Please sign in to comment.