@tap-payments/auth-jsconnect 2.4.99-test → 2.5.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.
package/build/app/settings.js
CHANGED
|
@@ -86,7 +86,9 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
86
86
|
if (typeof maturity_1 === 'boolean')
|
|
87
87
|
matureData = maturity_1 ? 'full' : 'express';
|
|
88
88
|
thunkApi.dispatch(handleSetAppConfig(configInfo));
|
|
89
|
-
thunkApi.dispatch(handleLanguage(
|
|
89
|
+
thunkApi.dispatch(handleLanguage(language_1 || lang));
|
|
90
|
+
if (public_key)
|
|
91
|
+
thunkApi.dispatch(handlePublicKey(public_key));
|
|
90
92
|
if (typeof board_maturity === 'boolean')
|
|
91
93
|
thunkApi.dispatch(handelBoardMaturity(board_maturity));
|
|
92
94
|
onVerifyConfigTokenSuccess === null || onVerifyConfigTokenSuccess === void 0 ? void 0 : onVerifyConfigTokenSuccess(config);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { LibConfig } from '../../@types';
|
|
3
3
|
export interface ConnectLibProps extends LibConfig {
|
|
4
4
|
configToken?: string;
|
|
5
|
+
leadId?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare function ConnectElement(props: ConnectLibProps): JSX.Element;
|
|
7
8
|
export declare function renderConnectLib(config: ConnectLibProps, elementId: string): {
|
|
@@ -63,16 +63,17 @@ import Background from '../shared/Background';
|
|
|
63
63
|
var Connect = memo(function (props) {
|
|
64
64
|
var theme = useAppTheme().theme;
|
|
65
65
|
var dispatch = useAppDispatch();
|
|
66
|
+
var leadId = props.leadId, configToken = props.configToken;
|
|
66
67
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
67
68
|
var _b = useAppSelector(connectSelector), connectError = _b.error, loading = _b.loading, customLoading = _b.customLoading;
|
|
68
69
|
var onVerifyConfigTokenSuccess = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
-
var
|
|
70
|
+
var id;
|
|
70
71
|
return __generator(this, function (_a) {
|
|
71
72
|
switch (_a.label) {
|
|
72
73
|
case 0:
|
|
73
|
-
|
|
74
|
-
if (!
|
|
75
|
-
return [4, dispatch(retrieveLead(
|
|
74
|
+
id = (data === null || data === void 0 ? void 0 : data.lead_id) || leadId;
|
|
75
|
+
if (!id) return [3, 2];
|
|
76
|
+
return [4, dispatch(retrieveLead(id))];
|
|
76
77
|
case 1:
|
|
77
78
|
_a.sent();
|
|
78
79
|
_a.label = 2;
|
|
@@ -80,7 +81,7 @@ var Connect = memo(function (props) {
|
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
}); };
|
|
83
|
-
useAppConfig(__assign(__assign(__assign({ navigation: CONNECT_SCREENS_NAVIGATION, maturity: 'full' }, props), { configToken:
|
|
84
|
+
useAppConfig(__assign(__assign(__assign({ navigation: CONNECT_SCREENS_NAVIGATION, maturity: 'full' }, props), { configToken: configToken }), (configToken && { onVerifyConfigTokenSuccess: onVerifyConfigTokenSuccess })));
|
|
84
85
|
useErrorListener(connectError || error, {
|
|
85
86
|
event: 'Send Event',
|
|
86
87
|
event_category: 'User Registration Flow',
|
|
@@ -96,6 +97,9 @@ var Connect = memo(function (props) {
|
|
|
96
97
|
if (!settingLoading) {
|
|
97
98
|
if (isKW((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2))
|
|
98
99
|
dispatch(handleCurrentActiveScreen('CONNECT_MOBILE_STEP'));
|
|
100
|
+
if (leadId && !configToken) {
|
|
101
|
+
dispatch(retrieveLead(leadId));
|
|
102
|
+
}
|
|
99
103
|
}
|
|
100
104
|
}, [settingLoading]);
|
|
101
105
|
React.useEffect(function () {
|