-
Notifications
You must be signed in to change notification settings - Fork 43
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(ras-acc): performance enhancements and small fixes #1871
Conversation
62a121f
to
aa8765f
Compare
aa8765f
to
c952baa
Compare
@@ -7,7 +7,7 @@ | |||
* @return {void} | |||
*/ | |||
export function domReady( callback ) { | |||
if ( typeof document === 'undefined' ) { | |||
if ( typeof document === 'undefined' || typeof callback !== 'function' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses a random browser error where callback was undefined in some circumstances.
// Signal checkout registration. | ||
form.appendChild( | ||
createHiddenInput( newspackBlocksModal.checkout_registration_flag, '1' ) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want this called whenever the auth modal is opened by checkout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I tested this alongside Automattic/newspack-plugin#3391, so it included making purchases when already logged in and when I needed to sign up/sign in, and all worked well!
All Submissions:
Changes proposed in this Pull Request:
This PR makes some small fixes and performance updates.
This PR was opened while digging into potential issues with RAS-ACC loading times. We found that the issue wasn't specific to RAS-ACC but wanted to push these changes up anyway.
How to test the changes in this Pull Request:
Other information: