Skip to content

Commit

Permalink
chore: subscribe another callback to only render the captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 committed Jan 5, 2025
1 parent a4158c0 commit a5b4bd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions docs/static/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ document$.subscribe(function prepareSubForm() {
subscribeButton.addEventListener("click", subscribeButtonClick);
subscriptionForm.addEventListener("submit", subscribeButtonSubmit);
});

document$.subscribe(function initializeCaptcha() {
hcaptcha.render("h-captcha-0de6fb2e-eb24-454a-8dfe-4f6c9670ab7e", {
theme: "dark",
sitekey: "0de6fb2e-eb24-454a-8dfe-4f6c9670ab7e",
});
});
1 change: 1 addition & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ super() }}
{% include "partials/pirsch.html" ignore missing %}
{% include "partials/logrocket.html" ignore missing %}
{% include "partials/subscription-header.html" ignore missing %}
{% include "blog-refactor-compatibility.html" ignore missing %}
{% endblock %}

Expand Down
8 changes: 1 addition & 7 deletions overrides/partials/subscription-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ <h3>Subscribe to Newsletter</h3>
checked
value="ea947371-ce6e-46e5-ade0-736c1a72d55e"
/>
<div
id="h-captcha-0de6fb2e-eb24-454a-8dfe-4f6c9670ab7e"
class="h-captcha"
data-theme="dark"
data-sitekey="0de6fb2e-eb24-454a-8dfe-4f6c9670ab7e"
></div>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<div id="h-captcha-0de6fb2e-eb24-454a-8dfe-4f6c9670ab7e"></div>
<input
class="md-button md-button--primary"
type="submit"
Expand Down

0 comments on commit a5b4bd4

Please sign in to comment.