@tap-payments/auth-jsconnect 2.6.33-test → 2.6.35-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.
@@ -270,15 +270,15 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
270
270
  _k.sent();
271
271
  _k.label = 11;
272
272
  case 11:
273
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
273
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP')); });
274
274
  return [3, 23];
275
275
  case 12:
276
276
  if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 13];
277
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
277
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP')); });
278
278
  return [3, 23];
279
279
  case 13:
280
280
  if (!hasBusinessCustomersCompleted) return [3, 14];
281
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
281
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP')); });
282
282
  return [3, 23];
283
283
  case 14:
284
284
  if (!hasBusinessCRActivitiesCompleted) return [3, 19];
@@ -295,7 +295,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
295
295
  return [4, API.brandService.retrieveBrand(brandID)];
296
296
  case 18:
297
297
  brandData = _k.sent();
298
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
298
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP')); });
299
299
  return [3, 23];
300
300
  case 19:
301
301
  if (!hasBusinessCRInfoCompleted) return [3, 22];
@@ -306,10 +306,10 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
306
306
  return [4, API.brandService.retrieveBrand(brandID)];
307
307
  case 21:
308
308
  brandData = _k.sent();
309
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
309
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP')); });
310
310
  return [3, 23];
311
311
  case 22:
312
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
312
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP')); });
313
313
  _k.label = 23;
314
314
  case 23: return [2, { data: data, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData, currencyData: currencyData }];
315
315
  }
@@ -723,7 +723,8 @@ export var updateLeadSuccess = createAsyncThunk('businessUpdateLeadSuccess', fun
723
723
  case 0:
724
724
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
725
725
  _b = business.data.verify.responseBody || {}, steps = _b.steps, lead_id = _b.lead_id;
726
- flowCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
726
+ flowCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
727
+ console.info('stop success call', flowCompleted || !lead_id);
727
728
  if (flowCompleted || !lead_id)
728
729
  return [2];
729
730
  boardResponse = undefined;
@@ -101,6 +101,7 @@ var BusinessCountry = function (_a) {
101
101
  var _e = React.useState(!!defaultOpen), open = _e[0], setOpen = _e[1];
102
102
  var _f = React.useState(''), subIndex = _f[0], setSubIndex = _f[1];
103
103
  var _g = React.useState(), selectedCountry = _g[0], setSelectedCountry = _g[1];
104
+ var _h = React.useState(''), searchValue = _h[0], setSearchValue = _h[1];
104
105
  var t = useTranslation().t;
105
106
  var isAr = useLanguage().isAr;
106
107
  var countryValue = selectedCountry;
@@ -139,16 +140,21 @@ var BusinessCountry = function (_a) {
139
140
  }
140
141
  });
141
142
  });
142
- }, [defaultCountryIso2]);
143
+ }, [defaultCountryIso2, open]);
143
144
  var handleSearch = function (value) {
144
- if (value === '') {
145
+ if (!value) {
146
+ setSearchValue('');
145
147
  setCountryList(countries);
146
148
  return;
147
149
  }
148
- var filteredList = countryList === null || countryList === void 0 ? void 0 : countryList.filter(function (country) {
149
- var _a, _b;
150
- return ((_a = country.countries) === null || _a === void 0 ? void 0 : _a.find(function (obj) { return obj.country.name_en.toLowerCase().includes(value.toLowerCase()); })) ||
151
- ((_b = country.countries) === null || _b === void 0 ? void 0 : _b.find(function (obj) { return obj.country.name_ar.toLowerCase().includes(value.toLowerCase()); }));
150
+ setSearchValue(value);
151
+ var filteredList = (countries !== null && countries !== void 0 ? countries : []).map(function (country) {
152
+ var _a;
153
+ var subCountries = (_a = country.countries) === null || _a === void 0 ? void 0 : _a.filter(function (obj) {
154
+ var name = isAr ? obj.country.name_ar : obj.country.name_en;
155
+ return name.toLowerCase().includes(value.toLowerCase());
156
+ });
157
+ return __assign(__assign({}, country), { countries: subCountries });
152
158
  });
153
159
  setCountryList(filteredList);
154
160
  };
@@ -157,7 +163,7 @@ var BusinessCountry = function (_a) {
157
163
  handleOpenSubMenu(item.id.toString());
158
164
  }, renderItem: function (item) {
159
165
  var isSelected = !!item.countries.find(function (c) { var _a; return c.country.iso2.toLocaleLowerCase() === ((_a = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _a === void 0 ? void 0 : _a.iso2.toLocaleLowerCase()); });
160
- return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, { children: [_jsx(NameContainer, __assign({ sx: { padding: 0 }, isSelected: isSelected }, { children: item.title })), _jsx(ExpandIcon, { anchorEl: subIndex === item.id.toString() })] }), _jsx(Collapse, __assign({ in: item.id.toString() === subIndex }, { children: _jsx(CountryListStyled, { sx: { pt: 0, pb: 0 }, list: item.countries || [], onSelectItem: function (i, e) {
166
+ return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, { children: [_jsx(NameContainer, __assign({ sx: { padding: 0 }, isSelected: isSelected }, { children: item.title })), _jsx(ExpandIcon, { anchorEl: subIndex === item.id.toString() })] }), _jsx(Collapse, __assign({ in: item.id.toString() === subIndex || !!searchValue }, { children: _jsx(CountryListStyled, { sx: { pt: 0, pb: 0 }, list: item.countries || [], onSelectItem: function (i, e) {
161
167
  e.stopPropagation();
162
168
  onSelectItem(i);
163
169
  }, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.6.33-test",
3
+ "version": "2.6.35-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",