-
Notifications
You must be signed in to change notification settings - Fork 48
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
trigger an error if the api script is not loaded #138
Conversation
@zoryana94 @DSergiu hi, could you take a look at this pr? |
@zoryana94 @DSergiu ping |
Hi @andrepolischuk thanks for the PR. Looks pretty good overall, I've added a few comments above. |
One last note, looks good! Just to confirm, as it looks like it, this update will handle multiple hCaptcha components loading at the same time waiting for the script tag to load correct? |
yes. first instance of the component mounts the script and waits promise (in module root) to handle onload. the rest of instances check mounted script in dom, and wait the same promise to handle onload. |
I think we can bump this version to |
@brdlyptrs I pulled latest master into this branch |
@brdlyptrs are you planning to publish this soon? |
Hi @andrepolischuk, |
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 can version bump separately.
also I rewrited mounting the api script with global
Promise
to fix case with multiple captchas. if multiple captchas are using, handleOnLoad callback is pushed to the onLoadListeners only for first component. next captchas in componentDidMount have apiScriptRequested true, so handleOnLoad is not adding to callback's array