Skip to content

Commit

Permalink
Add didSeeReportInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed Mar 8, 2024
1 parent 796f157 commit 51803e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"branch" : "jacek/report-on-toggle",
"revision" : "3f2c639a70bc928d211ad552c0cdc2ea58252d8c"
"revision" : "f7e1a3eb46ec011b531e7e7ef3c87bb6b1aa1eff"
}
},
{
Expand Down Expand Up @@ -87,7 +87,7 @@
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"branch" : "02-22-simple_report_screen",
"revision" : "72e544adf13e8bd55b28af24aa09029d2796daa1"
"revision" : "2e8139b6dec68919e0f5eaea29b10f390eb71ad8"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ extension PrivacyDashboardViewController: PrivacyDashboardReportBrokenSiteDelega
extension PrivacyDashboardViewController: PrivacyDashboardToggleReportDelegate {

func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController,
didRequestSubmitToggleReportWithSource source: BrokenSiteReport.Source) {
didRequestSubmitToggleReportWithSource source: BrokenSiteReport.Source,
didOpenReportInfo: Bool) {
do {
let report = try makeBrokenSiteReport(source: source)
let report = try makeBrokenSiteReport(source: source, didOpenReportInfo: didOpenReportInfo)
try toggleProtectionsOffReporter.report(report, reportMode: .toggle)
} catch {
os_log("Failed to generate or send the broken site report: %@", type: .error, error.localizedDescription)
Expand All @@ -297,7 +298,8 @@ extension PrivacyDashboardViewController {

private func makeBrokenSiteReport(category: String = "",
description: String = "",
source: BrokenSiteReport.Source) throws -> BrokenSiteReport {
source: BrokenSiteReport.Source,
didOpenReportInfo: Bool = false) throws -> BrokenSiteReport {

// ⚠️ To limit privacy risk, site URL is trimmed to not include query and fragment
guard let currentTab = tabViewModel?.tab,
Expand Down Expand Up @@ -337,7 +339,8 @@ extension PrivacyDashboardViewController {
protectionsState: protectionsState,
reportFlow: source,
errors: errors,
httpStatusCodes: statusCodes)
httpStatusCodes: statusCodes,
didOpenReportInfo: didOpenReportInfo)
return websiteBreakage
}
}

0 comments on commit 51803e1

Please sign in to comment.