@tap-payments/auth-jsconnect 2.6.23-test → 2.6.25-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
|
@@ -53,7 +53,7 @@ import i18n from '../i18n';
|
|
|
53
53
|
import { updateLocale } from '../utils/locale';
|
|
54
54
|
import API, { getAxiosHeaders, setAxiosGlobalHeaders } from '../api';
|
|
55
55
|
export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, country_code, domain, language_1, country, scope, public_key, maturity_1, board_maturity, post, platform_redirect_url, data, deviceInfo, isValidOperator, countries, countryCode, businessCountry, ipCountry;
|
|
56
|
+
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, country_code, domain, language_1, country, scope, public_key, maturity_1, board_maturity, post, platform_redirect_url, data, lead_id, deviceInfo, isValidOperator, countries, countryCode, businessCountry, ipCountry;
|
|
57
57
|
return __generator(this, function (_f) {
|
|
58
58
|
switch (_f.label) {
|
|
59
59
|
case 0:
|
|
@@ -81,8 +81,8 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
81
81
|
list = (country_list || { list: [] }).list;
|
|
82
82
|
_e = ip_info || {}, ip = _e.ip, latitude = _e.latitude, longitude = _e.longitude, country_code = _e.country_code;
|
|
83
83
|
if (config) {
|
|
84
|
-
domain = config.domain, language_1 = config.language, country = config.country, scope = config.scope, public_key = config.public_key, maturity_1 = config.maturity, board_maturity = config.board_maturity, post = config.post, platform_redirect_url = config.platform_redirect_url, data = config.data;
|
|
85
|
-
configInfo = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), (domain && { merchantDomain: domain })), (language_1 && { language: language_1 })), (country && { businessCountryCode: country })), (scope && { scope: scope })), (public_key && { publicKey: public_key })), ((post === null || post === void 0 ? void 0 : post.url) && { postURL: post === null || post === void 0 ? void 0 : post.url })), (platform_redirect_url && { redirectUrl: platform_redirect_url })), (data && { data: data }));
|
|
84
|
+
domain = config.domain, language_1 = config.language, country = config.country, scope = config.scope, public_key = config.public_key, maturity_1 = config.maturity, board_maturity = config.board_maturity, post = config.post, platform_redirect_url = config.platform_redirect_url, data = config.data, lead_id = config.lead_id;
|
|
85
|
+
configInfo = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), (domain && { merchantDomain: domain })), (language_1 && { language: language_1 })), (country && { businessCountryCode: country })), (scope && { scope: scope })), (public_key && { publicKey: public_key })), ((post === null || post === void 0 ? void 0 : post.url) && { postURL: post === null || post === void 0 ? void 0 : post.url })), (platform_redirect_url && { redirectUrl: platform_redirect_url })), (data && { data: data })), (lead_id && { leadId: lead_id }));
|
|
86
86
|
if (typeof maturity_1 === 'boolean')
|
|
87
87
|
matureData = maturity_1 ? 'full' : 'express';
|
|
88
88
|
thunkApi.dispatch(handleSetAppConfig(configInfo));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LibConfig } from '../../@types';
|
|
3
3
|
export interface BoardLibProps extends LibConfig {
|
|
4
|
-
|
|
4
|
+
configToken: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function BoardElement(props: BoardLibProps): JSX.Element;
|
|
7
7
|
export declare function renderBoardLib(config: BoardLibProps, elementId: string): {
|
|
@@ -36,11 +36,11 @@ import { boardFeatureScreens } from '../featuresScreens';
|
|
|
36
36
|
import { createVerifyTokenBy, boardSelector } from '../../features/app/board/boardStore';
|
|
37
37
|
import Background from '../shared/Background';
|
|
38
38
|
var Board = memo(function (_a) {
|
|
39
|
-
var
|
|
39
|
+
var configToken = _a.configToken, props = __rest(_a, ["configToken"]);
|
|
40
40
|
var theme = useAppTheme().theme;
|
|
41
41
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
42
42
|
var _c = useAppSelector(boardSelector), customLoading = _c.customLoading, loading = _c.loading, bankError = _c.error;
|
|
43
|
-
useAppConfig(__assign({ navigation: BOARD_SCREENS_NAVIGATION }, props));
|
|
43
|
+
useAppConfig(__assign(__assign({ navigation: BOARD_SCREENS_NAVIGATION }, props), { configToken: configToken }));
|
|
44
44
|
useErrorListener(bankError || error);
|
|
45
45
|
useStepStartedListener();
|
|
46
46
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress;
|
|
@@ -51,8 +51,10 @@ var Board = memo(function (_a) {
|
|
|
51
51
|
});
|
|
52
52
|
}, []);
|
|
53
53
|
React.useEffect(function () {
|
|
54
|
-
if (data.isValidOperator && props.open && !settingLoading)
|
|
55
|
-
|
|
54
|
+
if (data.isValidOperator && props.open && !settingLoading) {
|
|
55
|
+
console.log('data', data);
|
|
56
|
+
dispatch(createVerifyTokenBy(data.appConfig.leadId));
|
|
57
|
+
}
|
|
56
58
|
}, [data.isValidOperator, settingLoading]);
|
|
57
59
|
var initialLoading = settingLoading || customLoading;
|
|
58
60
|
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: boardFeatureScreens.map(function (_a, index) {
|
|
@@ -46,9 +46,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
46
46
|
flexDirection: 'column'
|
|
47
47
|
}); });
|
|
48
48
|
var VerifyNumber = function (_a) {
|
|
49
|
-
var _b;
|
|
49
|
+
var _b, _c;
|
|
50
50
|
var dispatch = useAppDispatch();
|
|
51
|
-
var
|
|
51
|
+
var _d = useAppSelector(boardSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
52
52
|
var methods = useForm({
|
|
53
53
|
resolver: yupResolver(OTPValidation),
|
|
54
54
|
defaultValues: data.otpData,
|
|
@@ -56,8 +56,8 @@ var VerifyNumber = function (_a) {
|
|
|
56
56
|
});
|
|
57
57
|
var t = useTranslation().t;
|
|
58
58
|
var isAr = useLanguage().isAr;
|
|
59
|
-
var
|
|
60
|
-
var phone = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by.sent_to;
|
|
59
|
+
var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
|
|
60
|
+
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
|
|
61
61
|
React.useEffect(function () {
|
|
62
62
|
if (error && methods.formState.isValid && phone)
|
|
63
63
|
dispatch(clearError());
|