ordering-ui-react-native 0.15.87 → 0.15.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.15.87",
3
+ "version": "0.15.88",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -25,7 +25,8 @@ const ForgotPasswordUI = (props: any) => {
25
25
  formState,
26
26
  handleButtonForgotPasswordClick,
27
27
  handleReCaptcha,
28
- enableReCaptcha
28
+ enableReCaptcha,
29
+ reCaptchaValue
29
30
  } = props;
30
31
  const [, t] = useLanguage();
31
32
  const [, { showToast }] = useToast();
@@ -58,9 +59,12 @@ const ForgotPasswordUI = (props: any) => {
58
59
  onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''))
59
60
  }
60
61
 
61
- const handleOpenRecaptcha = () => {
62
+ const handleOpenRecaptcha = () => {
62
63
  setRecaptchaVerified(false)
63
- if (!recaptchaConfig?.siteKey) {
64
+ handleReCaptcha(null)
65
+ if (reCaptchaValue) return
66
+
67
+ if (!recaptchaConfig?.siteKey) {
64
68
  showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
65
69
  return
66
70
  }
@@ -76,6 +80,11 @@ const ForgotPasswordUI = (props: any) => {
76
80
  handleReCaptcha(token)
77
81
  }
78
82
 
83
+ const handleRecaptchaExpire = () => {
84
+ setRecaptchaVerified(false)
85
+ handleReCaptcha(null)
86
+ }
87
+
79
88
  useEffect(() => {
80
89
  if (!formState.loading && emailSent) {
81
90
  if (formState.result?.error) {
@@ -192,7 +201,7 @@ const ForgotPasswordUI = (props: any) => {
192
201
  siteKey={recaptchaConfig?.siteKey}
193
202
  baseUrl={recaptchaConfig?.baseUrl}
194
203
  onVerify={onRecaptchaVerify}
195
- onExpire={() => setRecaptchaVerified(false)}
204
+ onExpire={handleRecaptchaExpire}
196
205
  />
197
206
  </>
198
207
  )}