@tap-payments/auth-jsconnect 2.3.40-test → 2.3.43-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.
- package/build/@types/form.d.ts +0 -3
- package/build/api/entity.d.ts +0 -1
- package/build/api/index.d.ts +0 -3
- package/build/api/index.js +1 -3
- package/build/assets/locales/ar.json +0 -1
- package/build/assets/locales/en.json +0 -1
- package/build/constants/app.js +4 -10
- package/build/features/app/bank/bankStore.d.ts +0 -1
- package/build/features/app/bank/bankStore.js +21 -37
- package/build/features/app/entity/entityStore.d.ts +1 -9
- package/build/features/app/entity/entityStore.js +48 -119
- package/build/features/app/individual/individualStore.d.ts +0 -2
- package/build/features/app/individual/individualStore.js +71 -91
- package/build/features/app/tax/taxStore.js +18 -36
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +2 -2
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +2 -2
- package/build/features/entity/screens/Verify/OTPInput.js +5 -3
- package/build/features/featuresScreens.js +0 -5
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/shared/Address/Address.js +13 -20
- package/build/features/shared/Address/CountryList.js +3 -3
- package/build/features/shared/Button/FlowsButtons.js +14 -19
- package/build/features/shared/OTP/OTP.d.ts +2 -1
- package/build/features/shared/OTP/OTP.js +2 -2
- package/build/features/tax/screens/Verify/OTPInput.js +5 -3
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/package.json +1 -1
- package/build/api/address.d.ts +0 -4
- package/build/api/address.js +0 -12
- package/build/features/entity/screens/EntityAddress/EntityAddress.d.ts +0 -5
- package/build/features/entity/screens/EntityAddress/EntityAddress.js +0 -42
- package/build/features/entity/screens/EntityAddress/index.d.ts +0 -2
- package/build/features/entity/screens/EntityAddress/index.js +0 -2
|
@@ -75,10 +75,10 @@ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountry
|
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
76
76
|
var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
|
|
77
77
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
-
var payload, settings, data, boardData, individualData, countryCode, boardInfoData,
|
|
79
|
-
var _c, _d, _e, _f, _g, _h, _j
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
78
|
+
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry;
|
|
79
|
+
var _c, _d, _e, _f, _g, _h, _j;
|
|
80
|
+
return __generator(this, function (_k) {
|
|
81
|
+
switch (_k.label) {
|
|
82
82
|
case 0:
|
|
83
83
|
payload = {
|
|
84
84
|
service_name: 'tap_email',
|
|
@@ -87,8 +87,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
87
87
|
settings = thunkApi.getState().settings;
|
|
88
88
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
89
89
|
case 1:
|
|
90
|
-
data = (
|
|
91
|
-
|
|
90
|
+
data = (_k.sent()).data;
|
|
91
|
+
boardInfoData = undefined;
|
|
92
92
|
countries = settings.data.countries;
|
|
93
93
|
if (((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
94
94
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
@@ -100,70 +100,61 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
100
100
|
}
|
|
101
101
|
if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
|
|
102
102
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
|
|
103
|
-
return [3,
|
|
103
|
+
return [3, 15];
|
|
104
104
|
case 2:
|
|
105
|
-
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3,
|
|
105
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 14];
|
|
106
106
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
107
107
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
108
108
|
if (!(board_id && board_info_id)) return [3, 5];
|
|
109
109
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
110
110
|
case 3:
|
|
111
|
-
boardInfoData =
|
|
111
|
+
boardInfoData = _k.sent();
|
|
112
112
|
notification = (boardInfoData || {}).notification;
|
|
113
113
|
_b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
|
|
114
114
|
if (!(id && type)) return [3, 5];
|
|
115
115
|
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
116
116
|
case 4:
|
|
117
|
-
data_1 = (
|
|
117
|
+
data_1 = (_k.sent()).data;
|
|
118
118
|
individualData = data_1 || {};
|
|
119
|
-
|
|
119
|
+
_k.label = 5;
|
|
120
120
|
case 5:
|
|
121
|
-
if (!board_id) return [3,
|
|
121
|
+
if (!board_id) return [3, 7];
|
|
122
122
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
123
123
|
case 6:
|
|
124
|
-
boardData =
|
|
125
|
-
|
|
124
|
+
boardData = _k.sent();
|
|
125
|
+
_k.label = 7;
|
|
126
126
|
case 7:
|
|
127
|
-
boardInfoStatus = _l.sent();
|
|
128
|
-
_l.label = 8;
|
|
129
|
-
case 8:
|
|
130
127
|
if (!countryCode) {
|
|
131
128
|
countryCode = (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.country;
|
|
132
129
|
if (countryCode)
|
|
133
130
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
134
131
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
|
|
133
|
+
if (!((_e = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _e === void 0 ? void 0 : _e.id)) return [3, 9];
|
|
134
|
+
return [4, thunkApi.dispatch(getIndividualList((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id))];
|
|
135
|
+
case 8:
|
|
136
|
+
_k.sent();
|
|
137
|
+
_k.label = 9;
|
|
140
138
|
case 9:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
|
|
139
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
140
|
+
return [3, 13];
|
|
144
141
|
case 10:
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
birthCountry = ((_g = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _g === void 0 ? void 0 : _g.country) || countryCode;
|
|
143
|
+
if (!birthCountry) return [3, 12];
|
|
144
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
147
145
|
case 11:
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
_k.sent();
|
|
147
|
+
_k.label = 12;
|
|
150
148
|
case 12:
|
|
151
|
-
birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
|
|
152
|
-
if (!birthCountry) return [3, 14];
|
|
153
|
-
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
154
|
-
case 13:
|
|
155
|
-
_l.sent();
|
|
156
|
-
_l.label = 14;
|
|
157
|
-
case 14:
|
|
158
149
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
159
|
-
|
|
160
|
-
case
|
|
161
|
-
case
|
|
150
|
+
_k.label = 13;
|
|
151
|
+
case 13: return [3, 15];
|
|
152
|
+
case 14:
|
|
162
153
|
if (isUpdatePhoneInfo) {
|
|
163
154
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
|
|
164
155
|
}
|
|
165
|
-
|
|
166
|
-
case
|
|
156
|
+
_k.label = 15;
|
|
157
|
+
case 15: return [2, {
|
|
167
158
|
data: data,
|
|
168
159
|
boardResponse: {
|
|
169
160
|
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
@@ -171,14 +162,13 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
171
162
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
172
163
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
173
164
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
174
|
-
name: (
|
|
175
|
-
contact: (
|
|
165
|
+
name: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.names,
|
|
166
|
+
contact: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.contact,
|
|
176
167
|
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
177
168
|
countries: countries,
|
|
178
169
|
countryCode: countryCode,
|
|
179
170
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
180
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
181
|
-
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
171
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
182
172
|
},
|
|
183
173
|
token: token
|
|
184
174
|
}];
|
|
@@ -411,10 +401,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
411
401
|
});
|
|
412
402
|
}); });
|
|
413
403
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
414
|
-
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData,
|
|
415
|
-
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
416
|
-
return __generator(this, function (
|
|
417
|
-
switch (
|
|
404
|
+
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, countryCode, notification, _c, id, type, data_3, birthCountry;
|
|
405
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
406
|
+
return __generator(this, function (_p) {
|
|
407
|
+
switch (_p.label) {
|
|
418
408
|
case 0:
|
|
419
409
|
_a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
|
|
420
410
|
responseBody = individual.data.verify.responseBody;
|
|
@@ -429,62 +419,53 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
429
419
|
};
|
|
430
420
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
431
421
|
case 1:
|
|
432
|
-
data = (
|
|
433
|
-
|
|
422
|
+
data = (_p.sent()).data;
|
|
423
|
+
boardData = undefined;
|
|
434
424
|
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
435
425
|
throw new Error(data.errors[0].description);
|
|
436
|
-
if (!board_id) return [3,
|
|
426
|
+
if (!board_id) return [3, 3];
|
|
437
427
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
438
428
|
case 2:
|
|
439
|
-
boardData =
|
|
440
|
-
|
|
429
|
+
boardData = _p.sent();
|
|
430
|
+
_p.label = 3;
|
|
441
431
|
case 3:
|
|
442
|
-
boardInfoStatus = _q.sent();
|
|
443
|
-
_q.label = 4;
|
|
444
|
-
case 4:
|
|
445
432
|
countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
|
|
446
|
-
if (!(board_id && board_info_id)) return [3,
|
|
433
|
+
if (!(board_id && board_info_id)) return [3, 6];
|
|
447
434
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
448
|
-
case
|
|
449
|
-
boardInfoData =
|
|
435
|
+
case 4:
|
|
436
|
+
boardInfoData = _p.sent();
|
|
450
437
|
notification = (boardInfoData || {}).notification;
|
|
451
438
|
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
452
|
-
if (!(id && type)) return [3,
|
|
439
|
+
if (!(id && type)) return [3, 6];
|
|
453
440
|
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
454
|
-
case
|
|
455
|
-
data_3 = (
|
|
441
|
+
case 5:
|
|
442
|
+
data_3 = (_p.sent()).data;
|
|
456
443
|
individualData = data_3 || {};
|
|
457
|
-
|
|
458
|
-
case
|
|
444
|
+
_p.label = 6;
|
|
445
|
+
case 6:
|
|
459
446
|
if (countryCode)
|
|
460
447
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
448
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 9];
|
|
449
|
+
if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 8];
|
|
450
|
+
return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
|
|
451
|
+
case 7:
|
|
452
|
+
_p.sent();
|
|
453
|
+
_p.label = 8;
|
|
466
454
|
case 8:
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
|
|
455
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
456
|
+
return [3, 12];
|
|
470
457
|
case 9:
|
|
471
|
-
|
|
472
|
-
|
|
458
|
+
birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
|
|
459
|
+
if (!birthCountry) return [3, 11];
|
|
460
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
473
461
|
case 10:
|
|
474
|
-
|
|
475
|
-
|
|
462
|
+
_p.sent();
|
|
463
|
+
_p.label = 11;
|
|
476
464
|
case 11:
|
|
477
|
-
birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
|
|
478
|
-
if (!birthCountry) return [3, 13];
|
|
479
|
-
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
480
|
-
case 12:
|
|
481
|
-
_q.sent();
|
|
482
|
-
_q.label = 13;
|
|
483
|
-
case 13:
|
|
484
465
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
485
|
-
|
|
486
|
-
case
|
|
487
|
-
(
|
|
466
|
+
_p.label = 12;
|
|
467
|
+
case 12:
|
|
468
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
|
|
488
469
|
return [2, {
|
|
489
470
|
data: data,
|
|
490
471
|
boardResponse: {
|
|
@@ -493,14 +474,13 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
493
474
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
494
475
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
495
476
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
496
|
-
name: (
|
|
497
|
-
contact: (
|
|
477
|
+
name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
|
|
478
|
+
contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
|
|
498
479
|
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
499
480
|
countries: countries,
|
|
500
481
|
countryCode: countryCode,
|
|
501
482
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
502
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
503
|
-
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
483
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business
|
|
504
484
|
},
|
|
505
485
|
formData: __assign({}, params)
|
|
506
486
|
}];
|
|
@@ -55,10 +55,10 @@ import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue, sleep } from '..
|
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data, boardData,
|
|
59
|
-
var _b, _c, _d
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var payload, data, boardData, countryIso2;
|
|
59
|
+
var _b, _c, _d;
|
|
60
|
+
return __generator(this, function (_e) {
|
|
61
|
+
switch (_e.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
payload = {
|
|
64
64
|
service_name: 'tap_email',
|
|
@@ -66,30 +66,22 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
66
66
|
};
|
|
67
67
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
68
68
|
case 1:
|
|
69
|
-
data = (
|
|
70
|
-
|
|
69
|
+
data = (_e.sent()).data;
|
|
70
|
+
boardData = undefined;
|
|
71
71
|
if (((_b = data.errors) === null || _b === void 0 ? void 0 : _b.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
72
72
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
73
73
|
if (isInternally)
|
|
74
74
|
data.step_name = TAX_STEP_NAMES.TAX_INFO;
|
|
75
|
-
if (!data.id) return [3,
|
|
76
|
-
return [4, API.boardService.retrieveBoardInfoStatus(data.id)];
|
|
77
|
-
case 2:
|
|
78
|
-
boardInfoData = _f.sent();
|
|
75
|
+
if (!data.id) return [3, 3];
|
|
79
76
|
return [4, API.boardService.retrieveBoardDetails(data === null || data === void 0 ? void 0 : data.id)];
|
|
77
|
+
case 2:
|
|
78
|
+
boardData = _e.sent();
|
|
79
|
+
_e.label = 3;
|
|
80
80
|
case 3:
|
|
81
|
-
boardData = _f.sent();
|
|
82
|
-
_f.label = 4;
|
|
83
|
-
case 4:
|
|
84
|
-
info = (boardInfoData || {}).info;
|
|
85
81
|
countryIso2 = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country;
|
|
86
82
|
if (countryIso2)
|
|
87
83
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
88
|
-
|
|
89
|
-
if (hasTaxCompleted) {
|
|
90
|
-
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
91
|
-
}
|
|
92
|
-
else if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
|
|
84
|
+
if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
|
|
93
85
|
thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
|
|
94
86
|
}
|
|
95
87
|
else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
|
|
@@ -97,7 +89,7 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
97
89
|
}
|
|
98
90
|
return [2, {
|
|
99
91
|
data: data,
|
|
100
|
-
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), {
|
|
92
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, business: boardData === null || boardData === void 0 ? void 0 : boardData.business }),
|
|
101
93
|
token: token
|
|
102
94
|
}];
|
|
103
95
|
}
|
|
@@ -133,10 +125,10 @@ export var retrieveEntityInfo = createAsyncThunk('retrieveTaxEntityInfo', functi
|
|
|
133
125
|
});
|
|
134
126
|
}); });
|
|
135
127
|
export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
136
|
-
var _a, tax, settings, responseBody, payload, data
|
|
137
|
-
var _b, _c, _d, _e
|
|
138
|
-
return __generator(this, function (
|
|
139
|
-
switch (
|
|
128
|
+
var _a, tax, settings, responseBody, payload, data;
|
|
129
|
+
var _b, _c, _d, _e;
|
|
130
|
+
return __generator(this, function (_f) {
|
|
131
|
+
switch (_f.label) {
|
|
140
132
|
case 0:
|
|
141
133
|
_a = thunkApi.getState(), tax = _a.tax, settings = _a.settings;
|
|
142
134
|
responseBody = tax.data.verify.responseBody;
|
|
@@ -149,22 +141,12 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
149
141
|
};
|
|
150
142
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
151
143
|
case 1:
|
|
152
|
-
data = (
|
|
144
|
+
data = (_f.sent()).data;
|
|
153
145
|
if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
|
|
154
146
|
throw new Error(data.errors[0].description);
|
|
155
147
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
156
|
-
flows = (responseBody || {}).flows;
|
|
157
|
-
hasTaxCompleted = ((_f = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'tax'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
158
|
-
if (!hasTaxCompleted) return [3, 3];
|
|
159
|
-
return [4, thunkApi.dispatch(retrieveEntityInfo((_g = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _g === void 0 ? void 0 : _g.id))];
|
|
160
|
-
case 2:
|
|
161
|
-
_h.sent();
|
|
162
|
-
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
163
|
-
return [3, 4];
|
|
164
|
-
case 3:
|
|
165
148
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
|
|
166
|
-
|
|
167
|
-
case 4: return [2, { data: data, formData: params }];
|
|
149
|
+
return [2, { data: data, formData: params }];
|
|
168
150
|
}
|
|
169
151
|
});
|
|
170
152
|
}); });
|
|
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
|
|
|
17
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
-
import {
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { resendOTP, bankSelector } from '../../../app/bank/bankStore';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(bankSelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|
|
@@ -46,7 +46,7 @@ var BrandInfo = function (_a) {
|
|
|
46
46
|
var t = useTranslation().t;
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var settingData = useAppSelector(settingsSelector).data;
|
|
49
|
-
var _e = useAppSelector(brandSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
49
|
+
var _e = useAppSelector(brandSelector), data = _e.data, loading = _e.loading, error = _e.error, uploadingBrandLogo = _e.uploadingBrandLogo;
|
|
50
50
|
var _f = data.brandData, brandName = _f.brandName, segment = _f.segment, teamSize = _f.teamSize, salesChannels = _f.salesChannels, brandLogoId = _f.brandLogoId, responseBody = _f.responseBody;
|
|
51
51
|
var _g = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, logo_details = _g.logo_details, data_status = _g.data_status;
|
|
52
52
|
var methods = useForm({
|
|
@@ -77,7 +77,7 @@ var BrandInfo = function (_a) {
|
|
|
77
77
|
methods.setError('brandName', { message: 'brand_name_already_exist' });
|
|
78
78
|
}, [responseBody]);
|
|
79
79
|
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
80
|
-
var disabled = brandErrChecks || brandNameChecking;
|
|
80
|
+
var disabled = brandErrChecks || brandNameChecking || uploadingBrandLogo;
|
|
81
81
|
var handleMenuClick = function (flag) {
|
|
82
82
|
setListActive(flag);
|
|
83
83
|
};
|
|
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
|
|
|
17
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
-
import { resendOTP } from '../../../app/brand/brandStore';
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { brandSelector, resendOTP } from '../../../app/brand/brandStore';
|
|
22
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(brandSelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|
|
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
15
15
|
import Box from '@mui/material/Box/Box';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import OTPField from '../../../shared/OTP';
|
|
18
18
|
import { useController, useFormContext } from 'react-hook-form';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
21
|
-
import {
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { businessSelector, resendOTP } from '../../../app/business/businessStore';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(businessSelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|
|
@@ -33,7 +33,7 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
33
33
|
}); });
|
|
34
34
|
var EntityCapital = function (_a) {
|
|
35
35
|
var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
36
|
-
var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
36
|
+
var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error, uploading = _c.uploading;
|
|
37
37
|
var isAr = useLanguage().isAr;
|
|
38
38
|
var t = useTranslation().t;
|
|
39
39
|
var dispatch = useAppDispatch();
|
|
@@ -71,7 +71,7 @@ var EntityCapital = function (_a) {
|
|
|
71
71
|
var handleActivitiesOpenClose = function (flag) {
|
|
72
72
|
setAnchorEl(flag);
|
|
73
73
|
};
|
|
74
|
-
var disabled = !methods.formState.isValid || !!error;
|
|
74
|
+
var disabled = !methods.formState.isValid || !!error || uploading;
|
|
75
75
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'] }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'] }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
|
|
76
76
|
};
|
|
77
77
|
export default EntityCapital;
|
|
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
|
|
|
17
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
-
import {
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { entitySelector, resendOTP } from '../../../app/entity/entityStore';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(entitySelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|
|
@@ -65,7 +65,6 @@ import SignInPasswordPage from './signIn/screens/Password';
|
|
|
65
65
|
import EntityVerifyPage from './entity/screens/Verify';
|
|
66
66
|
import EntityNamePage from './entity/screens/EntityName';
|
|
67
67
|
import EntityCapitalPage from './entity/screens/EntityCapital';
|
|
68
|
-
import EntityAddressPage from './entity/screens/EntityAddress';
|
|
69
68
|
import EntitySuccessPage from './entity/screens/Success';
|
|
70
69
|
import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
|
|
71
70
|
import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
|
|
@@ -345,10 +344,6 @@ export var entityFeatureScreens = [
|
|
|
345
344
|
name: 'ENTITY_CAPITAL_STEP',
|
|
346
345
|
element: EntityCapitalPage
|
|
347
346
|
},
|
|
348
|
-
{
|
|
349
|
-
name: 'ENTITY_ADDRESS_STEP',
|
|
350
|
-
element: EntityAddressPage
|
|
351
|
-
},
|
|
352
347
|
{
|
|
353
348
|
name: 'ENTITY_DETAILS_SUCCESS_STEP',
|
|
354
349
|
element: EntitySuccessPage
|
|
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
15
15
|
import Box from '@mui/material/Box/Box';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import OTPField from '../../../shared/OTP';
|
|
18
18
|
import { useController, useFormContext } from 'react-hook-form';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
21
|
-
import {
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { individualSelector, resendOTP } from '../../../app/individual/individualStore';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(individualSelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|
|
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
15
15
|
import Box from '@mui/material/Box/Box';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import OTPField from '../../../shared/OTP';
|
|
18
18
|
import { useController, useFormContext } from 'react-hook-form';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
21
|
-
import {
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { passwordSelector, resendOTP } from '../../../app/password/passwordStore';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(passwordSelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|