captcha: fix page load

This commit is contained in:
undefined committed 2021-04-03 00:35:24 +08:00
1 parent 653d18b57b
commit 6317c9057f
2 files changed
+5 -4

No files matched your search

@@ -1,7 +1,7 @@
(() => {
const { AutoloadPage } = window.Hydro;
const { NamedPage } = window.Hydro;
const page = new AutoloadPage('recaptcha', () => {
const page = new NamedPage('user_register', () => {
function captcha(event) {
event.preventDefault();
grecaptcha.ready(function () {
@@ -11,7 +11,8 @@
});
});
}
document.getElementById('submit').onclick = captcha;
const element = document.getElementById('submit');
if (element) element.onclick = captcha;
});
window.Hydro.extraPages.push(page);