@tap-payments/auth-jsconnect 2.4.34-test → 2.4.37-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.
@@ -98,7 +98,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
98
98
  thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
99
99
  }
100
100
  else if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
101
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
101
+ thunkApi.dispatch(handleNextScreenStep());
102
102
  }
103
103
  return [2, {
104
104
  data: data,
@@ -468,7 +468,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
468
468
  });
469
469
  }); });
470
470
  export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
471
- var _a, settings, business, isNonSA, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, brandData, _c, message, error, brandRes, list, documentData, entityData, entityId, documentBody, payload_1;
471
+ var _a, settings, business, isNonSA, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, brandData, brandRes, _c, message, error, list, documentData, entityData, entityId, documentBody, payload_1;
472
472
  var _d, _e;
473
473
  return __generator(this, function (_f) {
474
474
  switch (_f.label) {
@@ -504,30 +504,31 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
504
504
  brandData = undefined;
505
505
  _f.label = 2;
506
506
  case 2:
507
- _f.trys.push([2, 4, , 8]);
507
+ _f.trys.push([2, 5, , 6]);
508
508
  return [4, API.accountService.createAccount(accountBody)];
509
509
  case 3:
510
510
  accountData = _f.sent();
511
- return [3, 8];
511
+ return [4, API.brandService.retrieveBrand(brand === null || brand === void 0 ? void 0 : brand.id)];
512
512
  case 4:
513
+ brandRes = (_f.sent()).brand;
514
+ brandData = brandRes;
515
+ return [3, 6];
516
+ case 5:
513
517
  _c = _f.sent();
514
518
  message = _c.message;
515
519
  error = message;
516
- if (!((error === null || error === void 0 ? void 0 : error.toLowerCase()) === 'entity with license already exist')) return [3, 6];
517
- return [4, API.brandService.retrieveBrand(brand === null || brand === void 0 ? void 0 : brand.id)];
518
- case 5:
519
- brandRes = (_f.sent()).brand;
520
- brandData = brandRes;
521
- stepName = 'BUSINESS_VERIFY_BRAND_INFO';
522
- return [3, 7];
523
- case 6: throw new Error(error);
524
- case 7: return [3, 8];
525
- case 8: return [4, API.dataService.getActivitiesIsIc()];
526
- case 9:
520
+ if ((error === null || error === void 0 ? void 0 : error.toLowerCase()) === 'entity with license already exist') {
521
+ stepName = 'BUSINESS_VERIFY_BRAND_INFO';
522
+ }
523
+ else
524
+ throw new Error(error);
525
+ return [3, 6];
526
+ case 6: return [4, API.dataService.getActivitiesIsIc()];
527
+ case 7:
527
528
  list = (_f.sent()).list;
528
529
  entityData = undefined;
529
530
  entityId = accountData === null || accountData === void 0 ? void 0 : accountData.entity_id;
530
- if (!((certificateId || []).length > 0)) return [3, 11];
531
+ if (!((certificateId || []).length > 0)) return [3, 9];
531
532
  documentBody = {
532
533
  entity_id: entityId || '',
533
534
  documents: [
@@ -538,20 +539,20 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
538
539
  ]
539
540
  };
540
541
  return [4, API.documentService.updateDocumentInfo(documentBody)];
541
- case 10:
542
+ case 8:
542
543
  documentData = _f.sent();
543
- _f.label = 11;
544
- case 11:
545
- if (!(articleId && entityId)) return [3, 13];
544
+ _f.label = 9;
545
+ case 9:
546
+ if (!(articleId && entityId)) return [3, 11];
546
547
  payload_1 = {
547
548
  id: (accountData === null || accountData === void 0 ? void 0 : accountData.entity_id) || '',
548
549
  AOA_file_id: articleId
549
550
  };
550
551
  return [4, API.entityService.updateEntity(payload_1)];
551
- case 12:
552
+ case 10:
552
553
  entityData = _f.sent();
553
- _f.label = 13;
554
- case 13:
554
+ _f.label = 11;
555
+ case 11:
555
556
  thunkApi.dispatch(handleNextScreenStep(stepName));
556
557
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
557
558
  return [2, { data: __assign(__assign({}, data), { brand: brandData }), formData: params, accountData: accountData, documentData: documentData, entityData: entityData, isicActivityList: list || [] }];
@@ -124,7 +124,7 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
124
124
  return [4, API.entityService.retrieveEntityType()];
125
125
  case 9:
126
126
  entityTypes = _j.sent();
127
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
127
+ thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
128
128
  _j.label = 10;
129
129
  case 10: return [2, {
130
130
  data: data,
@@ -148,7 +148,7 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
148
148
  _l.sent();
149
149
  _l.label = 13;
150
150
  case 13:
151
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
151
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
152
152
  _l.label = 14;
153
153
  case 14: return [3, 16];
154
154
  case 15:
@@ -97,7 +97,7 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
97
97
  thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
98
98
  }
99
99
  else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
100
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
100
+ thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
101
101
  }
102
102
  return [2, {
103
103
  data: data,
@@ -97,12 +97,17 @@ var ActivityList = function (_a) {
97
97
  var _f = React.useState(''), subItemIndex = _f[0], setSubItemIndex = _f[1];
98
98
  var t = useTranslation().t;
99
99
  var isAr = useLanguage().isAr;
100
- var control = useFormContext().control;
100
+ var _g = useFormContext(), control = _g.control, setValue = _g.setValue;
101
101
  var activitiesControl = useController({ name: 'activities', control: control });
102
102
  var data = useAppSelector(businessSelector).data;
103
103
  var entity = (data.verify.responseBody || {}).entity;
104
104
  var activityList = (data.businessTypeData.responseBody || {}).activityList;
105
105
  var controlValue = activitiesControl.field.value;
106
+ var selectedActivity = data.activitiesData.activities;
107
+ React.useEffect(function () {
108
+ if ((selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) !== (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length))
109
+ setValue('activities', selectedActivity);
110
+ }, [selectedActivity]);
106
111
  var handleOpenActivityMenu = function (event) {
107
112
  setActivityAnchorEl(event.currentTarget);
108
113
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.4.34-test",
3
+ "version": "2.4.37-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",