Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove donation prevention #37867

Merged
merged 3 commits into from
Dec 6, 2019

Conversation

ahmaxed
Copy link
Member

@ahmaxed ahmaxed commented Dec 3, 2019

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • None of my changes are plagiarized from another source without proper attribution.
  • All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
  • My changes do not use shortened URLs or affiliate links.

Closes #XXXXX

@ahmaxed ahmaxed requested a review from a team December 3, 2019 07:59
@gitpod-io
Copy link

gitpod-io bot commented Dec 3, 2019

@ahmaxed
Copy link
Member Author

ahmaxed commented Dec 3, 2019

@ojeytonwilliams turns out we don't need to prevent donation since donation prompts happen less often on the previous donation modal logic.

could you take a look please?

Copy link
Contributor

@ojeytonwilliams ojeytonwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing preventDonationRequests means that once you trigger the DonationModal you see it every time you mount a page inside /learn. To fix this, how about using preventDonationRequests, but only in showDonateModalSaga and have it flip canRequestDonation back to false?

That way the donation message should always be visible on certs and the donation modal should only pop up after you complete a block (but if you complete multiple blocks in a session, you will see multiple modals).

@ahmaxed
Copy link
Member Author

ahmaxed commented Dec 4, 2019

@ojeytonwilliams you are right. although I am not sure I follow logic for using preventDonationRequests for setting canRequestDonation back go false. in that case what would flip canRequestDonation to true?

How about flipping tryToShowDonationModal back to false after the donation pop up?

@ojeytonwilliams
Copy link
Contributor

in that case what would flip canRequestDonation to true?

That will happen each time you finish a block, same as before. The idea (in my last commit) is to have block completion flip canRequestDonation to true and then the modal's appearance (i.e. the saga) flips it back to false. That way the modal appears, once, each time you finish a block.

Copy link
Contributor

@ojeytonwilliams ojeytonwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ahmaxed ahmaxed merged commit d7c4fd7 into freeCodeCamp:master Dec 6, 2019
@ahmaxed ahmaxed deleted the fix/adjust-donaiton-logic branch December 6, 2019 05:43
abbathaw pushed a commit to abbathaw/freeCodeCamp that referenced this pull request Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants