@tap-payments/auth-jsconnect 2.0.47-test → 2.0.48-test
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.
|
@@ -114,11 +114,16 @@ export var authSlice = createSlice({
|
|
|
114
114
|
state.error = null;
|
|
115
115
|
})
|
|
116
116
|
.addCase(retrieveLead.fulfilled, function (state, action) {
|
|
117
|
-
var _a, _b;
|
|
117
|
+
var _a, _b, _c;
|
|
118
118
|
state.customLoading = false;
|
|
119
119
|
state.error = null;
|
|
120
120
|
var data = action.payload;
|
|
121
|
-
|
|
121
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
122
|
+
if (description) {
|
|
123
|
+
state.error = description;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
state.data.mobileNumber = ((_c = (_b = data === null || data === void 0 ? void 0 : data.contact) === null || _b === void 0 ? void 0 : _b.phone) === null || _c === void 0 ? void 0 : _c.number) || '';
|
|
122
127
|
})
|
|
123
128
|
.addCase(retrieveLead.rejected, function (state, action) {
|
|
124
129
|
state.loading = false;
|
|
@@ -56,7 +56,7 @@ var OTP = function () {
|
|
|
56
56
|
var t = useTranslation().t;
|
|
57
57
|
var isAr = useLanguage().isAr;
|
|
58
58
|
React.useEffect(function () {
|
|
59
|
-
if (error)
|
|
59
|
+
if (!!data.mobileNumber && error)
|
|
60
60
|
dispatch(clearError());
|
|
61
61
|
return function () {
|
|
62
62
|
dispatch(resetOTPScreen());
|
|
@@ -66,7 +66,7 @@ var OTP = function () {
|
|
|
66
66
|
dispatch(verifyAuthOTP(formData));
|
|
67
67
|
};
|
|
68
68
|
var disabled = !methods.formState.isValid || !!error;
|
|
69
|
-
var phone = data.mobileNumber
|
|
69
|
+
var phone = data.mobileNumber;
|
|
70
70
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disabled: disabled, disableBack: true, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
71
71
|
};
|
|
72
72
|
export default React.memo(OTP);
|