Skip to content

Commit

Permalink
Prevent showing survey twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrant committed Nov 22, 2024
1 parent 4ab693d commit cd92e84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/org/wikipedia/page/PageActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ class PageActivity : BaseActivity(), PageFragment.Callback, LinkPreviewDialog.Lo
}) {
delay(TimeUnit.SECONDS.toMillis(if (ReleaseUtil.isDevRelease) 1L else 10L))
pageFragment.historyEntry?.let {
if (it.source == HistoryEntry.SOURCE_RABBIT_HOLE_SEARCH) {
if (!Prefs.suggestedContentSurveyShown && it.source == HistoryEntry.SOURCE_RABBIT_HOLE_SEARCH) {
Prefs.suggestedContentSurveyShown = true
SurveyDialog.showFeedbackOptionsDialog(
this@PageActivity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,14 +858,16 @@ class ReadingListsFragment : Fragment(), SortReadingListsDialog.Callback, Readin
L.e(t)
}) {
delay(TimeUnit.SECONDS.toMillis(if (ReleaseUtil.isDevRelease) 1L else 10L))
Prefs.suggestedContentSurveyShown = true
SurveyDialog.showFeedbackOptionsDialog(
requireActivity(),
titleId = R.string.rabbit_holes_survey_dialog_title,
messageId = R.string.rabbit_holes_survey_dialog_body,
snackbarMessageId = R.string.survey_dialog_submitted_snackbar,
invokeSource = InvokeSource.RABBIT_HOLE_READING_LIST
)
if (!Prefs.suggestedContentSurveyShown) {
Prefs.suggestedContentSurveyShown = true
SurveyDialog.showFeedbackOptionsDialog(
requireActivity(),
titleId = R.string.rabbit_holes_survey_dialog_title,
messageId = R.string.rabbit_holes_survey_dialog_body,
snackbarMessageId = R.string.survey_dialog_submitted_snackbar,
invokeSource = InvokeSource.RABBIT_HOLE_READING_LIST
)
}
}
}

Expand Down

0 comments on commit cd92e84

Please sign in to comment.