Skip to content

Commit

Permalink
Merge pull request #335 from marsidev/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Huskydog9988 authored Apr 30, 2023
2 parents e669dcb + af19dd4 commit f90ef77
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions apps/web/components/TurnstileWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from '@chakra-ui/react';
import { Turnstile } from '@marsidev/react-turnstile';
import { Turnstile, TurnstileInstance } from '@marsidev/react-turnstile';
import { useRef, useEffect } from 'react';
interface WidgetProps {
valid(valid: boolean, tsToken?: string): void;
Expand All @@ -12,14 +12,10 @@ enum CallbackStates {
}

const TurnstileWidget = (props: WidgetProps) => {
const ref = useRef(null);
const ref = useRef<TurnstileInstance | null>(null);
useEffect(() => {
if (props.refreshState > 0) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
ref.current?.reset();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
ref.current?.render();
}
}, [props.refreshState]);
Expand Down

0 comments on commit f90ef77

Please sign in to comment.