@tap-payments/auth-jsconnect 2.0.126-test → 2.1.2-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.
@@ -1106,6 +1106,7 @@ export var businessSlice = createSlice({
1106
1106
  .addCase(updateLeadSuccess.fulfilled, function (state, action) {
1107
1107
  var _a, _b;
1108
1108
  state.loading = false;
1109
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: false });
1109
1110
  state.error = null;
1110
1111
  var response = (action.payload || {}).response;
1111
1112
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -1117,10 +1118,12 @@ export var businessSlice = createSlice({
1117
1118
  })
1118
1119
  .addCase(updateLeadSuccess.pending, function (state) {
1119
1120
  state.loading = true;
1121
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: true });
1120
1122
  state.error = null;
1121
1123
  })
1122
1124
  .addCase(updateLeadSuccess.rejected, function (state, action) {
1123
1125
  state.loading = false;
1126
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: false });
1124
1127
  state.error = action.error.message;
1125
1128
  });
1126
1129
  }
@@ -501,6 +501,10 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
501
501
  return [4, API.leadService.updateLead(payload)];
502
502
  case 5:
503
503
  lead = _g.sent();
504
+ if (!lead.brand) {
505
+ console.error('Internal server error: brand is not created');
506
+ throw new Error('Internal server error');
507
+ }
504
508
  brandReqBody = {
505
509
  id: ((_d = lead.brand) === null || _d === void 0 ? void 0 : _d.id) || '',
506
510
  channel_services: channel_services,
@@ -354,6 +354,7 @@ export var taxSlice = createSlice({
354
354
  .addCase(updateLeadSuccess.fulfilled, function (state, action) {
355
355
  var _a;
356
356
  state.loading = false;
357
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
357
358
  state.error = null;
358
359
  var response = (action.payload || {}).response;
359
360
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -366,10 +367,12 @@ export var taxSlice = createSlice({
366
367
  })
367
368
  .addCase(updateLeadSuccess.pending, function (state) {
368
369
  state.loading = true;
370
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: true });
369
371
  state.error = null;
370
372
  })
371
373
  .addCase(updateLeadSuccess.rejected, function (state, action) {
372
374
  state.loading = false;
375
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
373
376
  state.error = action.error.message;
374
377
  });
375
378
  }
@@ -7,10 +7,14 @@ import { bankSelector, updateBoardSuccess } from '../../../app/bank/bankStore';
7
7
  var Success = function (_a) {
8
8
  var t = useTranslation().t;
9
9
  var dispatch = useAppDispatch();
10
- var _b = useAppSelector(bankSelector), loading = _b.loading, error = _b.error;
11
- var onSuccess = function () {
10
+ var _b = useAppSelector(bankSelector), error = _b.error, loading = _b.loading;
11
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
12
+ React.useEffect(function () {
12
13
  dispatch(updateBoardSuccess());
14
+ }, []);
15
+ var onSuccess = function () {
16
+ setClicked(true);
13
17
  };
14
- return (_jsx(SuccessScreen, { title: t('bank_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
18
+ return (_jsx(SuccessScreen, { title: t('bank_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
15
19
  };
16
20
  export default React.memo(Success);
@@ -7,10 +7,17 @@ import { businessSelector, updateLeadSuccess } from '../../../app/business/busin
7
7
  var Success = function (_a) {
8
8
  var t = useTranslation().t;
9
9
  var dispatch = useAppDispatch();
10
- var _b = useAppSelector(businessSelector), loading = _b.loading, error = _b.error;
11
- var onSuccess = function () {
10
+ var _b = useAppSelector(businessSelector), error = _b.error, data = _b.data;
11
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
12
+ var verify = data.verify;
13
+ var responseBody = verify.responseBody;
14
+ var updateLeadSuccessLoading = (responseBody || {}).updateLeadSuccessLoading;
15
+ React.useEffect(function () {
12
16
  dispatch(updateLeadSuccess());
17
+ }, []);
18
+ var onSuccess = function () {
19
+ setClicked(true);
13
20
  };
14
- return (_jsx(SuccessScreen, { title: t('business_completed_title'), description: t('business_completed_description'), onSuccess: onSuccess, successTitle: t('business_completed_button'), loading: loading, error: error || '' }));
21
+ return (_jsx(SuccessScreen, { title: t('business_completed_title'), description: t('business_completed_description'), onSuccess: onSuccess, successTitle: t('business_completed_button'), loading: clicked && updateLeadSuccessLoading, error: error || '' }));
15
22
  };
16
23
  export default React.memo(Success);
@@ -7,10 +7,14 @@ import SuccessScreen from '../../../shared/SuccessScreen';
7
7
  var Success = function (_a) {
8
8
  var t = useTranslation().t;
9
9
  var dispatch = useAppDispatch();
10
- var _b = useAppSelector(entitySelector), loading = _b.loading, error = _b.error;
11
- var onSuccess = function () {
10
+ var _b = useAppSelector(entitySelector), error = _b.error, loading = _b.loading;
11
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
12
+ React.useEffect(function () {
12
13
  dispatch(updateBoardSuccess());
14
+ }, []);
15
+ var onSuccess = function () {
16
+ setClicked(true);
13
17
  };
14
- return (_jsx(SuccessScreen, { title: t('entity_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
18
+ return (_jsx(SuccessScreen, { title: t('entity_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
15
19
  };
16
20
  export default React.memo(Success);
@@ -7,10 +7,14 @@ import SuccessScreen from '../../../shared/SuccessScreen';
7
7
  var Success = function (_a) {
8
8
  var t = useTranslation().t;
9
9
  var dispatch = useAppDispatch();
10
- var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
11
- var onSuccess = function () {
10
+ var _b = useAppSelector(individualSelector), error = _b.error, loading = _b.loading;
11
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
12
+ React.useEffect(function () {
12
13
  dispatch(updateBoardSuccess());
14
+ }, []);
15
+ var onSuccess = function () {
16
+ setClicked(true);
13
17
  };
14
- return (_jsx(SuccessScreen, { title: t('individual_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
18
+ return (_jsx(SuccessScreen, { title: t('individual_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
15
19
  };
16
20
  export default React.memo(Success);
@@ -36,7 +36,8 @@ var ContainerStyled = styled(Container)(function (_a) {
36
36
  return ({
37
37
  justifyContent: 'space-between',
38
38
  minHeight: theme.spacing(30),
39
- alignItems: 'center'
39
+ alignItems: 'center',
40
+ pointerEvents: 'auto'
40
41
  });
41
42
  });
42
43
  var IconStyled = styled(Icon)(function (_a) {
@@ -7,10 +7,16 @@ import SuccessScreen from '../../../shared/SuccessScreen';
7
7
  var Success = function (_a) {
8
8
  var t = useTranslation().t;
9
9
  var dispatch = useAppDispatch();
10
- var _b = useAppSelector(taxSelector), loading = _b.loading, error = _b.error;
11
- var onSuccess = function () {
10
+ var _b = useAppSelector(taxSelector), error = _b.error, data = _b.data;
11
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
12
+ var responseBody = data.verify.responseBody;
13
+ var updateBoardSuccessLoading = (responseBody || {}).updateBoardSuccessLoading;
14
+ React.useEffect(function () {
12
15
  dispatch(updateLeadSuccess());
16
+ }, []);
17
+ var onSuccess = function () {
18
+ setClicked(true);
13
19
  };
14
- return (_jsx(SuccessScreen, { title: t('tax_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
20
+ return (_jsx(SuccessScreen, { title: t('tax_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && updateBoardSuccessLoading, error: error || '' }));
15
21
  };
16
22
  export default React.memo(Success);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.126-test",
3
+ "version": "2.1.2-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",