Skip to content

Commit

Permalink
✨ add timeout prop
Browse files Browse the repository at this point in the history
  • Loading branch information
erickcrus committed Jan 12, 2024
1 parent 9023f4c commit 620229f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@erickcrus/react-native-recaptcha",
"version": "0.1.9",
"version": "0.1.10",
"private": false,
"license": "MIT",
"description": "⚛ A lightweight new invisible recaptcha lib",
Expand Down
10 changes: 8 additions & 2 deletions src/Recaptcha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ export type RecaptchaProps = {
* Ativar debug
*/
debug?: boolean;

/**
* Timeout para expirar o recaptcha
*/
timeout?: number;
};

const Recaptcha = forwardRef<RecaptchaRef, RecaptchaProps>((props, $ref) => {
Expand All @@ -181,7 +186,8 @@ const Recaptcha = forwardRef<RecaptchaRef, RecaptchaProps>((props, $ref) => {
hideBadge,
hideLoader,
enterprise,
debug
debug,
timeout: _timeout,
} = props;

const $webView = useRef<WebView>(null);
Expand Down Expand Up @@ -270,7 +276,7 @@ const Recaptcha = forwardRef<RecaptchaRef, RecaptchaProps>((props, $ref) => {
true;
`);
setLoading(false);
}, 30000);
}, _timeout ?? 30000);

// run recaptcha
containerOpacity.value = 1;
Expand Down

0 comments on commit 620229f

Please sign in to comment.