@akinon/pz-otp 1.119.0-rc.2 → 1.119.0
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/CHANGELOG.md +1 -13
- package/package.json +1 -1
- package/src/views/Otp.tsx +9 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# @akinon/pz-otp
|
|
2
2
|
|
|
3
|
-
## 1.119.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- 6ad72e8d: ZERO-4032: Add loading state management for payment submissions across multiple components and add safe guarding
|
|
8
|
-
|
|
9
|
-
## 1.119.0-rc.1
|
|
10
|
-
|
|
11
|
-
## 1.119.0-rc.0
|
|
12
|
-
|
|
13
|
-
### Minor Changes
|
|
14
|
-
|
|
15
|
-
- 6ad72e8d: ZERO-4032: Add loading state management for payment submissions across multiple components and add safe guarding
|
|
3
|
+
## 1.119.0
|
|
16
4
|
|
|
17
5
|
## 1.118.0
|
|
18
6
|
|
package/package.json
CHANGED
package/src/views/Otp.tsx
CHANGED
|
@@ -73,7 +73,6 @@ export const Otp = ({
|
|
|
73
73
|
const [canResend, setCanResend] = useState(false);
|
|
74
74
|
const [time, setTime] = useState(timer);
|
|
75
75
|
const [hasError, setHasError] = useState(false);
|
|
76
|
-
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
77
76
|
const dispatch = useAppDispatch();
|
|
78
77
|
const { isPopupVisible } = useAppSelector((state) => state.otp);
|
|
79
78
|
|
|
@@ -85,26 +84,18 @@ export const Otp = ({
|
|
|
85
84
|
const onSubmit = async (event: FormEvent<HTMLFormElement>) => {
|
|
86
85
|
event.preventDefault();
|
|
87
86
|
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
if (submitAction) {
|
|
94
|
-
data.code = otp;
|
|
95
|
-
data.phone = phone;
|
|
96
|
-
const res = await submitAction(data);
|
|
87
|
+
if (submitAction) {
|
|
88
|
+
data.code = otp;
|
|
89
|
+
data.phone = phone;
|
|
90
|
+
const res = await submitAction(data);
|
|
97
91
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
if (res?.status !== 200 || error) {
|
|
93
|
+
setHasError(true);
|
|
94
|
+
}
|
|
101
95
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
96
|
+
if (res?.status === 200) {
|
|
97
|
+
dispatch(hidePopup());
|
|
105
98
|
}
|
|
106
|
-
} finally {
|
|
107
|
-
setIsSubmitting(false);
|
|
108
99
|
}
|
|
109
100
|
};
|
|
110
101
|
|
|
@@ -234,7 +225,6 @@ export const Otp = ({
|
|
|
234
225
|
{error && <p className="text-xs text-error mt-2">{error}</p>}
|
|
235
226
|
<Button
|
|
236
227
|
type="submit"
|
|
237
|
-
disabled={isSubmitting}
|
|
238
228
|
className={twMerge(
|
|
239
229
|
'mt-5 h-auto w-full py-4 text-lg font-medium uppercase',
|
|
240
230
|
classes?.submitButton
|