Skip to content

Commit

Permalink
Show prompt if all in-context dialogs have been shown (#5580)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1205008441501016/1209303563866691

### Description
Do not wait for the full onboarding to be completed to be able to show
the broken site prompt, just wait for all in-context dialogs to show

### Steps to test this PR

_Feature 1_
- [x] Fresh install
- [x] Complete the onboarding including all in-context dialogs but not
the PPro one
- [x] Visit wikipedia.org and refresh 3 times in succession
- [x] Check the broken sites prompt is shown

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
  • Loading branch information
CrisBarreiro authored Feb 3, 2025
1 parent 29f1cc2 commit d8b0190
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions app/src/main/java/com/duckduckgo/app/cta/ui/CtaViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,6 @@ class CtaViewModel @Inject constructor(
!hideTips() &&
(daxDialogNetworkShown() || daxDialogOtherShown() || daxDialogSerpShown() || daxDialogTrackersFoundShown())

private suspend fun canShowOnboardingDaxDialogCta(): Boolean {
return when {
!daxOnboardingActive() || hideTips() -> false
extendedOnboardingFeatureToggles.noBrowserCtas().isEnabled() -> {
settingsDataStore.hideTips = true
userStageStore.stageCompleted(AppStage.DAX_ONBOARDING)
false
}

else -> true
}
}

private suspend fun canShowPrivacyProCta(): Boolean {
return daxOnboardingActive() && !hideTips() && !daxDialogPrivacyProShown() &&
subscriptions.isEligible() && extendedOnboardingFeatureToggles.privacyProCta().isEnabled()
Expand All @@ -334,7 +321,7 @@ class CtaViewModel @Inject constructor(
return null
}

if (!canShowOnboardingDaxDialogCta()) {
if (areInContextDaxDialogsCompleted()) {
return if (brokenSitePrompt.shouldShowBrokenSitePrompt(nonNullSite.url)) {
BrokenSitePromptDialogCta()
} else {
Expand Down

0 comments on commit d8b0190

Please sign in to comment.