Skip to content

Commit

Permalink
Menu item to reset the pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstrba committed Apr 8, 2024
1 parent 4dcd8fb commit f8a8371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions DuckDuckGo/Menus/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ import SubscriptionUI
}
NSMenuItem(title: "Reset Email Protection InContext Signup Prompt", action: #selector(MainViewController.resetEmailProtectionInContextPrompt))
NSMenuItem(title: "Reset Daily Pixels", action: #selector(MainViewController.resetDailyPixels))
NSMenuItem(title: "Reset History Save Failed Daily Pixel", action: #selector(MainViewController.resetHistorySaveFailedDailyPixel(_:)))
}.withAccessibilityIdentifier("MainMenu.resetData")
NSMenuItem(title: "UI Triggers") {
NSMenuItem(title: "Show Save Credentials Popover", action: #selector(MainViewController.showSaveCredentialsPopover))
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/Menus/MainMenuActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,10 @@ extension MainViewController {
UserDefaults.standard.removePersistentDomain(forName: DailyPixel.Constant.dailyPixelStorageIdentifier)
}

@objc func resetHistorySaveFailedDailyPixel(_ sender: Any?) {
Pixel.shared?.clearRepetitions(for: .debug(event: .historySaveFailedDaily))
}

@objc func in10PercentSurveyOn(_ sender: Any?) {
UserDefaults.standard.set(true, forKey: UserDefaultsWrapper<Bool?>.Key.homePageShowSurveyDay14in10Percent.rawValue)
UserDefaults.standard.set(true, forKey: UserDefaultsWrapper<Bool?>.Key.homePageShowSurveyDay0in10Percent.rawValue)
Expand Down

0 comments on commit f8a8371

Please sign in to comment.