Skip to content

Commit

Permalink
Hide other surveys when the Privacy Pro survey is visible.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed May 23, 2024
1 parent f7564af commit c47e4ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Privacy-Pro-128.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
5 changes: 3 additions & 2 deletions DuckDuckGo/HomePage/Model/HomePageContinueSetUpModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ extension HomePage.Models {

private var shouldPermanentSurveyBeVisible: Bool {
return shouldShowPermanentSurvey &&
permanentSurveyManager.isSurveyAvailable
permanentSurveyManager.isSurveyAvailable &&
surveyRemoteMessaging.presentableRemoteMessages().isEmpty // When Privacy Pro survey is visible, ensure we do not show multiple at once
}

@MainActor private func visitSurvey() {
Expand Down Expand Up @@ -484,7 +485,7 @@ extension HomePage.Models {
case .permanentSurvey:
return .survey128.resized(to: iconSize)!
case .surveyRemoteMessage:
return .survey128.resized(to: iconSize)!
return .privacyProSurvey.resized(to: iconSize)!
case .dataBrokerProtectionWaitlistInvited:
return .dbpInformationRemover.resized(to: iconSize)!
}
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/HomePage/Resources/survey-messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cardTitle": "Title 1",
"cardDescription": "Description 1",
"attributes": {
"subscriptionStatus": "",
"subscriptionStatus": "Auto-Renewable",
"minimumDaysSinceSubscriptionStarted": 1,
"maximumDaysUntilSubscriptionExpirationOrRenewal": 30,
"daysSinceVPNEnabled": 2,
Expand Down

0 comments on commit c47e4ab

Please sign in to comment.