ublo-lib 1.31.26 → 1.31.28

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.
@@ -24,6 +24,7 @@ export default function useTunnel({
24
24
  lang,
25
25
  breadcrumb
26
26
  } = useUbloContext();
27
+ const [started, setStared] = React.useState(false);
27
28
  const {
28
29
  path: esfPath
29
30
  } = multipleVillages ? breadcrumb?.next : breadcrumb;
@@ -35,23 +36,26 @@ export default function useTunnel({
35
36
  await loadWidgetMseM(integration);
36
37
  const categoryCode = window.sessionStorage.getItem("categoryCode") || undefined;
37
38
  window.MseM?.onLoad(() => {
38
- window.requestAnimationFrame(() => window.MseM.tunnel({
39
- channel,
40
- resort,
41
- groundedTo,
42
- lang: widgetLang,
43
- esfUrl,
44
- customOffers,
45
- analytics: Plausible.callback,
46
- categoryCode
47
- }));
39
+ window.requestAnimationFrame(() => {
40
+ window.MseM.tunnel({
41
+ channel,
42
+ resort,
43
+ groundedTo,
44
+ lang: widgetLang,
45
+ esfUrl,
46
+ customOffers,
47
+ analytics: Plausible.callback,
48
+ categoryCode
49
+ });
50
+ setStared(true);
51
+ });
48
52
  });
49
53
  };
50
- if (enableCustomOffers && customOffers !== undefined || !enableCustomOffers) {
54
+ if (!started && (enableCustomOffers && customOffers !== undefined || !enableCustomOffers)) {
51
55
  startTunnel();
52
56
  }
53
57
  }
54
- }, [channel, cmsMode, customOffers, enableCustomOffers, esfUrl, groundedTo, integration, widgetLang]);
58
+ }, [channel, cmsMode, customOffers, enableCustomOffers, esfUrl, groundedTo, integration, started, widgetLang]);
55
59
  }
56
60
  async function loadWidgetMseM(integration) {
57
61
  const source = integration ? "https://widget-integration.msem.tech/static/js/widget-msem.js" : "https://widget.msem.tech/static/js/widget-msem.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.31.26",
3
+ "version": "1.31.28",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.8.3",
6
6
  "leaflet": "^1.9.1",