ublo-lib 1.9.4 → 1.9.5

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.
@@ -238,7 +238,7 @@ const Lodging = ({
238
238
  };
239
239
  setConfig(newConfig);
240
240
  if (lodgingPrefixUrl) {
241
- setPresetUrl(URLParams.getLodgingUrl({
241
+ setPresetUrl(URLParams.getLodgingUrl(lang, {
242
242
  presets,
243
243
  options: {
244
244
  resort: selectedResort,
@@ -246,7 +246,7 @@ const Lodging = ({
246
246
  }
247
247
  }, openPage, openPage ? lodgingPrefixUrl : linkOverride || lodgingPrefixUrl, noLodgingPage));
248
248
  }
249
- }, [data, kind, linkOverride, lodgingPrefixUrl, noLodgingPage, selectedResort, setConfig]);
249
+ }, [data, kind, lang, linkOverride, lodgingPrefixUrl, noLodgingPage, selectedResort, setConfig]);
250
250
  React.useEffect(() => {
251
251
  if (!data.lodging) {
252
252
  setData(data => ({
@@ -53,7 +53,7 @@ const useWidgets = (widgets, defaultOptions, mode, resorts, skiPassesUrl, setTun
53
53
  return;
54
54
  }
55
55
  if (isLodging && lodgingPrefixUrl) {
56
- const endpoint = URLParams.getLodgingUrl({
56
+ const endpoint = URLParams.getLodgingUrl(lang, {
57
57
  presets,
58
58
  options: {
59
59
  ...options,
@@ -24,7 +24,7 @@ export const getSkiPassesUrl = (lang, params, widgetUrl) => {
24
24
  }
25
25
  return `${protocol}//${host}/${lang}${widgetUrl}${encodedParams}`;
26
26
  };
27
- export const getLodgingUrl = (params, openPage, lodgingPrefixUrl, noLodgingPage) => {
27
+ export const getLodgingUrl = (lang, params, openPage, lodgingPrefixUrl, noLodgingPage) => {
28
28
  const accomodation = params.presets.accomodation;
29
29
  const {
30
30
  host,
@@ -32,7 +32,7 @@ export const getLodgingUrl = (params, openPage, lodgingPrefixUrl, noLodgingPage)
32
32
  } = window.location;
33
33
  const encodedParams = build(params);
34
34
  const isExternalUrl = lodgingPrefixUrl.startsWith("http");
35
- const commonUrl = isExternalUrl ? lodgingPrefixUrl : `${protocol}//${host}${lodgingPrefixUrl}`;
35
+ const commonUrl = isExternalUrl ? lodgingPrefixUrl : `${protocol}//${host}/${lang}${lodgingPrefixUrl}`;
36
36
  if (openPage && !noLodgingPage) {
37
37
  return `${commonUrl}/${accomodation}${encodedParams}`;
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.1.0",
6
6
  "next": "^12.0.0 || ^13.0.0",