fix: add check for newsletter modal and fix typo #3727
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
This PR makes sure that the content gate doesn't refresh the page after purchases before the reader can run through the newsletter sign up step of the checkout.
It also fixes a small typo in the
openNewslettersSignupModal()
config settings (changingDissmiss
toDismiss
). This doesn't appear to be used anywhere else yet, but I'd appreciate confirmation!See: 1200550061930446-as-1209271919879010
How to test the changes in this Pull Request:
A lot of the preliminary testing setup is the same as Automattic/newspack-blocks#2044, so it may make sense to test these together!
Bonus testing:
10. If you're testing with Automattic/newspack-blocks#2044, repeat step 4, but purchase the membership with the variable subscription. Confirm that the newsletter form doesn't refresh until you've submitted it/closed it.
11. In a new incognito window, repeat steps 7 and 8; for the latter, use the variable subscription product to purchase the membership. Confirm that the newsletter sign up form is not shown, and that the post refreshes to hide the Content Gate.
Smoke testing
12. Run through a few regular checkouts in incognito windows. Subscribe to different newsletters, and confirm they are removed from the list when you repeat the email address, and that the newsletter prompt disappears entirely once you've signed up for all.
Other information: