ublo-lib 1.9.4 → 1.9.6
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,8 @@ 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
|
|
35
|
+
const langPrefix = openPage ? `/${lang}` : "";
|
|
36
|
+
const commonUrl = isExternalUrl ? lodgingPrefixUrl : `${protocol}//${host}${langPrefix}${lodgingPrefixUrl}`;
|
|
36
37
|
if (openPage && !noLodgingPage) {
|
|
37
38
|
return `${commonUrl}/${accomodation}${encodedParams}`;
|
|
38
39
|
}
|