@tap-payments/auth-jsconnect 2.0.90-test → 2.0.92-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.
@@ -1,4 +1,4 @@
1
1
  declare const firebaseService: {
2
- getLocale: () => Promise<any>;
2
+ getLocale: (disableLocale?: boolean) => Promise<any>;
3
3
  };
4
4
  export { firebaseService };
@@ -1,6 +1,8 @@
1
1
  import { ENDPOINT_PATHS } from '../constants';
2
2
  import { httpClient } from './axios';
3
- var getLocale = function () {
3
+ var getLocale = function (disableLocale) {
4
+ if (disableLocale)
5
+ return Promise.resolve(null);
4
6
  return httpClient({
5
7
  method: 'get',
6
8
  url: ENDPOINT_PATHS.FIREBASE_URL
@@ -52,7 +52,7 @@ declare const API: {
52
52
  checkIbanBank: (data: import("./availabilityServices").CheckIBanBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
53
53
  };
54
54
  firebaseService: {
55
- getLocale: () => Promise<any>;
55
+ getLocale: (disableLocale?: boolean | undefined) => Promise<any>;
56
56
  };
57
57
  accountService: {
58
58
  createAccount: (data: CreateAccountBody) => Promise<any>;
@@ -7,6 +7,7 @@ export declare const fetchAppSettingsSync: import("@reduxjs/toolkit").AsyncThunk
7
7
  deviceInfo: DeviceInfo;
8
8
  }, {
9
9
  disableCountries?: boolean | undefined;
10
+ disableLocale?: boolean | undefined;
10
11
  }, {}>;
11
12
  export interface SettingsData {
12
13
  skin: ThemeMode;
@@ -53,18 +53,18 @@ import i18n from '../i18n';
53
53
  import { updateLocale } from '../utils/locale';
54
54
  import API, { 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, disableCountries, _c, visitorId, _d, ip, latitude, longitude, locale, list, operatorData, deviceInfo, countries, businessCountry;
56
+ var settings, _a, appConfig, language, _b, client, device, os, disableCountries, disableLocale, _c, visitorId, _d, ip, latitude, longitude, locale, list, operatorData, deviceInfo, countries, businessCountry;
57
57
  return __generator(this, function (_e) {
58
58
  switch (_e.label) {
59
59
  case 0:
60
60
  settings = thunkApi.getState().settings;
61
61
  _a = settings.data, appConfig = _a.appConfig, language = _a.language;
62
62
  _b = getBrowserInfo(), client = _b.client, device = _b.device, os = _b.os;
63
- disableCountries = params.disableCountries;
63
+ disableCountries = params.disableCountries, disableLocale = params.disableLocale;
64
64
  return [4, Promise.all([
65
65
  getFingerPrint(),
66
66
  API.ipService.getIP(),
67
- API.firebaseService.getLocale(),
67
+ API.firebaseService.getLocale(disableLocale),
68
68
  API.countryService.getCountries(disableCountries)
69
69
  ])];
70
70
  case 1:
@@ -237,8 +237,11 @@ export var settingsSlice = createSlice({
237
237
  state.data.countries = countries;
238
238
  state.data.businessCountry = businessCountry;
239
239
  state.data.deviceInfo = deviceInfo;
240
- updateLocale(locale, businessCountry.iso2);
240
+ if (locale)
241
+ updateLocale(locale, businessCountry.iso2);
241
242
  state.loading = false;
243
+ if (state.data.appConfig.onReady)
244
+ state.data.appConfig.onReady();
242
245
  });
243
246
  builder.addCase(fetchAppSettingsSync.rejected, function (state, action) {
244
247
  state.loading = false;