@tap-payments/auth-jsconnect 2.9.39-development → 2.9.40-development

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.
@@ -285,17 +285,6 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
285
285
  prev: '',
286
286
  order: 8
287
287
  },
288
- {
289
- name: 'CONNECT_EXPRESS_GENERIC_PREPARING_DATA_STEP',
290
- next: [
291
- 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
292
- 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
293
- 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
294
- 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
295
- ],
296
- prev: '',
297
- order: 9
298
- },
299
288
  {
300
289
  name: 'CONNECT_EXPRESS_PREPARING_DATA_STEP',
301
290
  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);
@@ -30,7 +30,6 @@ import ConnectExpressCollectBusinessScreen from './connectExpress/screens/Collec
30
30
  import ConnectExpressVerifyAuthMobileOtpScreen from './connectExpress/screens/VerifyMobileAuthOTP';
31
31
  import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
32
32
  import ConnectExpressPreparingDataLoaderScreen from './connectExpress/screens/PrepareDataLoading';
33
- import ConnectExpressGenericPreparingDataLoaderScreen from './connectExpress/screens/GenericPrepareDataLoading';
34
33
  import ConnectExpressSuccessFlowButtonsScreen from './connectExpress/screens/SuccessWithFlowButtons';
35
34
  import ConnectExpressAccountAlreadyCreatedScreen from './connectExpress/screens/AccountAlreadyCreated';
36
35
  import ConnectExpressAuthenticationListScreen from './connectExpress/screens/AuthenticationList';
@@ -295,10 +294,6 @@ export var connectExpressFeatureScreens = [
295
294
  {
296
295
  name: 'COLLECT_MOBILE_OWNERSHIP',
297
296
  element: ConnectExpressCollectMobileOwnership
298
- },
299
- {
300
- name: 'CONNECT_EXPRESS_GENERIC_PREPARING_DATA_STEP',
301
- element: ConnectExpressGenericPreparingDataLoaderScreen
302
297
  }
303
298
  ];
304
299
  export var authFeatureScreens = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.9.39-development",
3
+ "version": "2.9.40-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",