Fix weird token element null issue
This commit is contained in:
@@ -112,9 +112,9 @@ export default function () {
|
|||||||
if (!logged_in) {
|
if (!logged_in) {
|
||||||
const tokenElem = document
|
const tokenElem = document
|
||||||
.getElementsByName("cf-turnstile-response")
|
.getElementsByName("cf-turnstile-response")
|
||||||
.item(0) as HTMLInputElement;
|
.item(0) as HTMLInputElement | null;
|
||||||
|
|
||||||
if (!tokenElem.value) {
|
if (!tokenElem?.value) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return toast({
|
return toast({
|
||||||
description: "Please complete the captcha and try again",
|
description: "Please complete the captcha and try again",
|
||||||
|
|||||||
Reference in New Issue
Block a user