@tap-payments/auth-jsconnect 2.10.8-beta → 2.10.10-beta

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.
@@ -46,13 +46,16 @@ export declare const createNafathAuth: import("@reduxjs/toolkit").AsyncThunk<{
46
46
  termAndConditionChecked?: boolean | undefined;
47
47
  };
48
48
  }, NIDFormValues, {}>;
49
+ declare type VerifyNafathAsyncParams = verifyPACIAsyncParams & {
50
+ showLoadingScreenAfterNafathSuccess: () => void;
51
+ };
49
52
  export declare const verifyNafathAsync: import("@reduxjs/toolkit").AsyncThunk<{
50
53
  data: any;
51
54
  isNextScreenIsDob?: undefined;
52
55
  } | {
53
56
  data: any;
54
57
  isNextScreenIsDob: boolean;
55
- }, verifyPACIAsyncParams, {}>;
58
+ }, VerifyNafathAsyncParams, {}>;
56
59
  export declare const createCivilIdAuthAsync: import("@reduxjs/toolkit").AsyncThunk<{
57
60
  response: any;
58
61
  formData: CivilFormValues;
@@ -186,34 +186,29 @@ export var retrieveEntityListAsync = createAsyncThunk('connectExpress/retrieveEn
186
186
  export var retrieveAuthenticationListAsync = createAsyncThunk('connectExpress/retrieveAuthenticationListAsync', function (_a) {
187
187
  var individualId = _a.individualId;
188
188
  return __awaiter(void 0, void 0, void 0, function () {
189
- var brandList, entityList, brands, err_1, list, err_2;
190
- return __generator(this, function (_b) {
191
- switch (_b.label) {
189
+ var brandList, entityList, _b, brandResponse, entityResponse, err_1;
190
+ return __generator(this, function (_c) {
191
+ switch (_c.label) {
192
192
  case 0:
193
193
  brandList = undefined;
194
194
  entityList = undefined;
195
- _b.label = 1;
195
+ _c.label = 1;
196
196
  case 1:
197
- _b.trys.push([1, 3, , 4]);
198
- return [4, API.brandService.getBrandList({ individual_id: individualId })];
197
+ _c.trys.push([1, 3, , 4]);
198
+ return [4, Promise.all([
199
+ API.brandService.getBrandList({ individual_id: individualId }),
200
+ API.entityService.getEntityListUsingIndividualId(individualId)
201
+ ])];
199
202
  case 2:
200
- brands = (_b.sent()).brands;
201
- brandList = brands;
203
+ _b = _c.sent(), brandResponse = _b[0], entityResponse = _b[1];
204
+ brandList = brandResponse.brands;
205
+ entityList = entityResponse.list;
202
206
  return [3, 4];
203
207
  case 3:
204
- err_1 = _b.sent();
208
+ err_1 = _c.sent();
209
+ console.error('Error fetching data:', err_1);
205
210
  return [3, 4];
206
- case 4:
207
- _b.trys.push([4, 6, , 7]);
208
- return [4, API.entityService.getEntityListUsingIndividualId(individualId)];
209
- case 5:
210
- list = (_b.sent()).list;
211
- entityList = list;
212
- return [3, 7];
213
- case 6:
214
- err_2 = _b.sent();
215
- return [3, 7];
216
- case 7: return [2, { brandList: brandList || [], entityList: entityList || [] }];
211
+ case 4: return [2, { brandList: brandList || [], entityList: entityList || [] }];
217
212
  }
218
213
  });
219
214
  });
@@ -405,6 +400,7 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
405
400
  return [2, { data: data }];
406
401
  }
407
402
  }
403
+ params.showLoadingScreenAfterNafathSuccess();
408
404
  if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 7];
409
405
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
410
406
  case 6:
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const GenericPrepareDataLoading: () => JSX.Element;
3
+ export default GenericPrepareDataLoading;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAppSelector } from '../../../../hooks';
3
+ import DataLoading from '../../../shared/DataLoading';
4
+ import { connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
5
+ var GenericPrepareDataLoading = function () {
6
+ var error = useAppSelector(connectExpressSelector).error;
7
+ return _jsx(DataLoading, { error: error });
8
+ };
9
+ export default GenericPrepareDataLoading;
@@ -0,0 +1,2 @@
1
+ import GenericPrepareDataLoading from './GenericPrepareDataLoading';
2
+ export default GenericPrepareDataLoading;
@@ -0,0 +1,2 @@
1
+ import GenericPrepareDataLoading from './GenericPrepareDataLoading';
2
+ export default GenericPrepareDataLoading;
@@ -4,14 +4,16 @@ import { connectExpressSelector, verifyNafathAsync } from '../../../app/connectE
4
4
  import NafathVerification from '../../../shared/NafathVerification';
5
5
  import { handlePrevScreenStep } from '../../../../app/settings';
6
6
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
+ import GenericPrepareDataLoading from '../GenericPrepareDataLoading';
7
8
  var VerifyNafath = function () {
8
9
  var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
10
  var _b = React.useState(false), failed = _b[0], setFailed = _b[1];
10
11
  var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
12
+ var _d = React.useState(false), showLoadingScreen = _d[0], setShowLoadingScreen = _d[1];
11
13
  var dispatch = useAppDispatch();
12
14
  var data = useAppSelector(connectExpressSelector).data;
13
15
  var authData = (data.responseData || {}).authData;
14
- var _d = authData || {}, expiry = _d.expiry, app_url_android = _d.app_url_android, app_url_ios = _d.app_url_ios, random = _d.random;
16
+ var _e = authData || {}, expiry = _e.expiry, app_url_android = _e.app_url_android, app_url_ios = _e.app_url_ios, random = _e.random;
15
17
  React.useEffect(function () {
16
18
  if (authData && !isReady) {
17
19
  setIsReady(true);
@@ -20,7 +22,11 @@ var VerifyNafath = function () {
20
22
  React.useEffect(function () {
21
23
  if (!isReady)
22
24
  return;
23
- var promise = dispatch(verifyNafathAsync({ onSuccess: function () { return setSuccess(true); }, onFailure: function () { return setFailed(true); } }));
25
+ var promise = dispatch(verifyNafathAsync({
26
+ onSuccess: function () { return setSuccess(true); },
27
+ onFailure: function () { return setFailed(true); },
28
+ showLoadingScreenAfterNafathSuccess: function () { return setShowLoadingScreen(true); }
29
+ }));
24
30
  return function () {
25
31
  promise === null || promise === void 0 ? void 0 : promise.abort();
26
32
  };
@@ -30,6 +36,6 @@ var VerifyNafath = function () {
30
36
  }, []);
31
37
  if (!isReady)
32
38
  return null;
33
- return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, failed: failed, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
39
+ return showLoadingScreen ? (_jsx(GenericPrepareDataLoading, {})) : (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, failed: failed, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
34
40
  };
35
41
  export default React.memo(VerifyNafath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.8-beta",
3
+ "version": "2.10.10-beta",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -112,8 +112,7 @@
112
112
  "lint-staged": {
113
113
  "src/**/*.{ts,tsx,json,js,jsx}": [
114
114
  "yarn run prettier:fix",
115
- "yarn run lint",
116
- "git add ."
115
+ "yarn run lint"
117
116
  ]
118
117
  },
119
118
  "browserslist": {