@tap-payments/auth-jsconnect 2.5.11-test → 2.5.13-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.
Files changed (22) hide show
  1. package/build/features/bank/screens/Verify/OTPInput.js +3 -1
  2. package/build/features/brand/screens/Verify/OTPInput.js +3 -1
  3. package/build/features/business/screens/OTP/OTPInput.js +5 -2
  4. package/build/features/business/screens/Verify/OTPInput.js +3 -1
  5. package/build/features/connect/screens/Individual/MobileNumber.js +0 -4
  6. package/build/features/connect/screens/Mobile/MobileNumber.js +0 -4
  7. package/build/features/connect/screens/OTP/OTPInput.js +4 -2
  8. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +0 -4
  9. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +4 -2
  10. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +0 -4
  11. package/build/features/connectExpress/screens/OTP/OTPInput.js +4 -2
  12. package/build/features/entity/screens/Verify/OTPInput.js +3 -1
  13. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -4
  14. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +0 -4
  15. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +0 -4
  16. package/build/features/individual/screens/Verify/OTPInput.js +3 -1
  17. package/build/features/password/screens/OTP/OTPInput.js +5 -2
  18. package/build/features/password/screens/Verify/OTPInput.js +3 -1
  19. package/build/features/signIn/screens/Mobile/MobileNumber.js +0 -4
  20. package/build/features/signIn/screens/OTP/OTPInput.js +4 -2
  21. package/build/features/tax/screens/Verify/OTPInput.js +3 -1
  22. package/package.json +1 -1
@@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { resendOTP, bankSelector } from '../../../app/bank/bankStore';
22
+ import { resendOTP, bankSelector, clearError } from '../../../app/bank/bankStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(bankSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -18,7 +18,7 @@ import { useController, useFormContext } from 'react-hook-form';
18
18
  import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
- import { brandSelector, resendOTP } from '../../../app/brand/brandStore';
21
+ import { brandSelector, clearError, resendOTP } from '../../../app/brand/brandStore';
22
22
  import { isTokenExpired } from '../../../../utils';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(brandSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { resendOTPLeadIdentity } from '../../../app/business/businessStore';
21
- import { useAppDispatch } from '../../../../hooks';
20
+ import { businessSelector, clearError, resendOTPLeadIdentity } from '../../../app/business/businessStore';
21
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
24
24
  return ({
@@ -31,8 +31,11 @@ var OTPInput = function (_a) {
31
31
  var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
+ var error = useAppSelector(businessSelector).error;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var handleOnOTPChange = function (otp) {
37
+ if (error)
38
+ dispatch(clearError());
36
39
  otpControl.field.onChange(otp);
37
40
  };
38
41
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { businessSelector, resendOTP } from '../../../app/business/businessStore';
22
+ import { businessSelector, clearError, resendOTP } from '../../../app/business/businessStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(businessSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -100,10 +100,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
100
100
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
101
101
  var _k = ((_f = (_e = data.otpData.responseBody) === null || _e === void 0 ? void 0 : _e.contact) === null || _f === void 0 ? void 0 : _f.phone) || {}, number = _k.number, country_code = _k.country_code;
102
102
  var readOnly = number && country_code && !error;
103
- React.useEffect(function () {
104
- if (mobileValue)
105
- setValue('mobile', mobileValue, { shouldValidate: true });
106
- }, []);
107
103
  var onPhoneNumberChange = function (_a) {
108
104
  var target = _a.target;
109
105
  var value = removeAllCharsFromNumber(target.value);
@@ -98,10 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
99
99
  var isStartsWith5 = mobileValue.startsWith('5');
100
100
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
101
- React.useEffect(function () {
102
- if (mobileValue)
103
- setValue('mobile', mobileValue, { shouldValidate: true });
104
- }, []);
105
101
  var onPhoneNumberChange = function (_a) {
106
102
  var target = _a.target;
107
103
  var value = removeAllCharsFromNumber(target.value);
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { AuthForType } from '../../../../@types';
21
- import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
21
+ import { clearError, connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  import { sendCustomEventToGTM } from '../../../../utils';
24
24
  var BoxStyled = styled(Box)(function (_a) {
@@ -34,9 +34,11 @@ var OTPInput = function (_a) {
34
34
  var t = useTranslation().t;
35
35
  var dispatch = useAppDispatch();
36
36
  var otpControl = useController({ name: 'otp', control: control });
37
- var data = useAppSelector(connectSelector).data;
37
+ var _c = useAppSelector(connectSelector), data = _c.data, error = _c.error;
38
38
  var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
39
39
  var handleOnOTPChange = function (otp) {
40
+ if (error)
41
+ dispatch(clearError());
40
42
  otpControl.field.onChange(otp);
41
43
  };
42
44
  var sendEventAskAnotherOTP = function () {
@@ -96,10 +96,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
96
96
  var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
97
97
  var isStartsWith5 = mobileValue.startsWith('5');
98
98
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
99
- React.useEffect(function () {
100
- if (mobileValue)
101
- setValue('mobile', mobileValue, { shouldValidate: true });
102
- }, []);
103
99
  var onPhoneNumberChange = function (_a) {
104
100
  var target = _a.target;
105
101
  var value = removeAllCharsFromNumber(target.value);
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { AuthForType } from '../../../../@types';
21
- import { resendNIDAuthIdentityOTP, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
21
+ import { resendNIDAuthIdentityOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -33,10 +33,12 @@ var OTPInput = function (_a) {
33
33
  var t = useTranslation().t;
34
34
  var dispatch = useAppDispatch();
35
35
  var otpControl = useController({ name: 'otp', control: control });
36
- var data = useAppSelector(connectExpressSelector).data;
36
+ var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
37
37
  var nidData = data.nidData;
38
38
  var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
39
39
  var handleOnOTPChange = function (otp) {
40
+ if (error)
41
+ dispatch(clearError());
40
42
  otpControl.field.onChange(otp);
41
43
  };
42
44
  var handleOnResendOTP = function () {
@@ -98,10 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
99
99
  var isStartsWith5 = mobileValue.startsWith('5');
100
100
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
101
- React.useEffect(function () {
102
- if (mobileValue)
103
- setValue('mobile', mobileValue, { shouldValidate: true });
104
- }, []);
105
101
  var onPhoneNumberChange = function (_a) {
106
102
  var target = _a.target;
107
103
  var value = removeAllCharsFromNumber(target.value);
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { AuthForType } from '../../../../@types';
21
- import { resendMobileAuthOTP, resendNIDAuthOTP, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
21
+ import { resendMobileAuthOTP, resendNIDAuthOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -33,10 +33,12 @@ var OTPInput = function (_a) {
33
33
  var t = useTranslation().t;
34
34
  var dispatch = useAppDispatch();
35
35
  var otpControl = useController({ name: 'otp', control: control });
36
- var data = useAppSelector(connectExpressSelector).data;
36
+ var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
37
37
  var mobileData = data.mobileData, nidData = data.nidData, responseData = data.responseData;
38
38
  var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
39
39
  var handleOnOTPChange = function (otp) {
40
+ if (error)
41
+ dispatch(clearError());
40
42
  otpControl.field.onChange(otp);
41
43
  };
42
44
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { entitySelector, resendOTP } from '../../../app/entity/entityStore';
22
+ import { clearError, entitySelector, resendOTP } from '../../../app/entity/entityStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(entitySelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -98,10 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var isStartsWith5 = mobileValue.startsWith('5');
99
99
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
100
100
  var verify = data.verify;
101
- React.useEffect(function () {
102
- if (mobileValue)
103
- setValue('mobile', mobileValue, { shouldValidate: true });
104
- }, []);
105
101
  var onPhoneNumberChange = function (_a) {
106
102
  var target = _a.target;
107
103
  var value = removeAllCharsFromNumber(target.value);
@@ -98,10 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
99
99
  var isStartsWith5 = mobileValue.startsWith('5');
100
100
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
101
- React.useEffect(function () {
102
- if (mobileValue)
103
- setValue('mobile', mobileValue, { shouldValidate: true });
104
- }, []);
105
101
  var onPhoneNumberChange = function (_a) {
106
102
  var target = _a.target;
107
103
  var value = removeAllCharsFromNumber(target.value);
@@ -98,10 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var isStartsWith5 = mobileValue.startsWith('5');
99
99
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
100
100
  var verify = data.verify;
101
- React.useEffect(function () {
102
- if (mobileValue)
103
- setValue('mobile', mobileValue, { shouldValidate: true });
104
- }, []);
105
101
  var onPhoneNumberChange = function (_a) {
106
102
  var target = _a.target;
107
103
  var value = removeAllCharsFromNumber(target.value);
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { individualSelector, resendOTP } from '../../../app/individual/individualStore';
22
+ import { clearError, individualSelector, resendOTP } from '../../../app/individual/individualStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(individualSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { useAppDispatch } from '../../../../hooks';
21
- import { resendOperationOTP } from '../../../../features/app/password/passwordStore';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { clearError, passwordSelector, resendOperationOTP } from '../../../../features/app/password/passwordStore';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
24
24
  return ({
@@ -32,7 +32,10 @@ var OTPInput = function (_a) {
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
+ var error = useAppSelector(passwordSelector).error;
35
36
  var handleOnOTPChange = function (otp) {
37
+ if (error)
38
+ dispatch(clearError());
36
39
  otpControl.field.onChange(otp);
37
40
  };
38
41
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { passwordSelector, resendOTP } from '../../../app/password/passwordStore';
22
+ import { clearError, passwordSelector, resendOTP } from '../../../app/password/passwordStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(passwordSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -98,10 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
99
99
  var isStartsWith5 = mobileValue.startsWith('5');
100
100
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
101
- React.useEffect(function () {
102
- if (mobileValue)
103
- setValue('mobile', mobileValue, { shouldValidate: true });
104
- }, []);
105
101
  var onPhoneNumberChange = function (_a) {
106
102
  var target = _a.target;
107
103
  var value = removeAllCharsFromNumber(target.value);
@@ -17,7 +17,7 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { signInSelector, resendOTPMobile, resendOTPEmail } from '../../../app/signIn/signInStore';
20
+ import { signInSelector, resendOTPMobile, resendOTPEmail, clearError } from '../../../app/signIn/signInStore';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
@@ -32,9 +32,11 @@ var OTPInput = function (_a) {
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
- var data = useAppSelector(signInSelector).data;
35
+ var _c = useAppSelector(signInSelector), data = _c.data, error = _c.error;
36
36
  var isEmail = !!data.auth.email;
37
37
  var handleOnOTPChange = function (otp) {
38
+ if (error)
39
+ dispatch(clearError());
38
40
  otpControl.field.onChange(otp);
39
41
  };
40
42
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { resendOTP, taxSelector } from '../../../app/tax/taxStore';
22
+ import { clearError, resendOTP, taxSelector } from '../../../app/tax/taxStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(taxSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.5.11-test",
3
+ "version": "2.5.13-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",