@tap-payments/auth-jsconnect 2.10.9-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.
@@ -270,17 +270,6 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
270
270
  prev: '',
271
271
  order: 7
272
272
  },
273
- {
274
- name: 'CONNECT_EXPRESS_GENERIC_PREPARING_DATA_STEP',
275
- next: [
276
- 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
277
- 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
278
- 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
279
- 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
280
- ],
281
- prev: '',
282
- order: 9
283
- },
284
273
  {
285
274
  name: 'CONNECT_EXPRESS_PREPARING_DATA_STEP',
286
275
  next: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
@@ -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;
@@ -385,7 +385,6 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
385
385
  return [2, { data: data }];
386
386
  }
387
387
  if (!isSuccess) return [3, 9];
388
- thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_GENERIC_PREPARING_DATA_STEP'));
389
388
  authId = (_j = data.auth) === null || _j === void 0 ? void 0 : _j.id;
390
389
  leadId = (_k = data.auth) === null || _k === void 0 ? void 0 : _k.lead_id;
391
390
  thunkApi.dispatch(storeAuthId(authId));
@@ -401,6 +400,7 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
401
400
  return [2, { data: data }];
402
401
  }
403
402
  }
403
+ params.showLoadingScreenAfterNafathSuccess();
404
404
  if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 7];
405
405
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
406
406
  case 6:
@@ -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);
@@ -29,7 +29,6 @@ import ConnectExpressCollectDobScreen from './connectExpress/screens/DOB';
29
29
  import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
30
30
  import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
31
31
  import ConnectExpressPreparingDataLoaderScreen from './connectExpress/screens/PrepareDataLoading';
32
- import ConnectExpressGenericPreparingDataLoaderScreen from './connectExpress/screens/GenericPrepareDataLoading';
33
32
  import ConnectExpressSuccessFlowButtonsScreen from './connectExpress/screens/SuccessWithFlowButtons';
34
33
  import ConnectExpressAccountAlreadyCreatedScreen from './connectExpress/screens/AccountAlreadyCreated';
35
34
  import ConnectExpressAuthenticationListScreen from './connectExpress/screens/AuthenticationList';
@@ -290,10 +289,6 @@ export var connectExpressFeatureScreens = [
290
289
  {
291
290
  name: 'COLLECT_MOBILE_OWNERSHIP',
292
291
  element: ConnectExpressCollectMobileOwnership
293
- },
294
- {
295
- name: 'CONNECT_EXPRESS_GENERIC_PREPARING_DATA_STEP',
296
- element: ConnectExpressGenericPreparingDataLoaderScreen
297
292
  }
298
293
  ];
299
294
  export var authFeatureScreens = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.9-beta",
3
+ "version": "2.10.10-beta",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",