tf-checkout-react 1.6.6-beta.24 → 1.6.6-beta.25

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,5 +1,5 @@
1
1
  {
2
- "version": "1.6.6-beta.24",
2
+ "version": "1.6.6-beta.25",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -54,6 +54,7 @@ export const ForgotPasswordModal: FC<IForgotPasswordProps> = ({
54
54
 
55
55
  const onForgotPassword = async ({ email }: ValuesTypes) => {
56
56
  if (showSuccess) {
57
+ setSuccessMessage(null)
57
58
  onClose()
58
59
  return
59
60
  }
@@ -63,11 +64,14 @@ export const ForgotPasswordModal: FC<IForgotPasswordProps> = ({
63
64
  const { data } = await forgotPassword(email)
64
65
 
65
66
  onForgotPasswordSuccess(data)
66
- onClose()
67
67
 
68
- if (data?.success) {
68
+ if (displaySuccessMessage && data?.success) {
69
69
  setSuccessMessage(data?.message)
70
70
  }
71
+
72
+ if (!displaySuccessMessage) {
73
+ onClose()
74
+ }
71
75
  } catch (e) {
72
76
  if (axios.isAxiosError(e)) {
73
77
  onForgotPasswordError(e)