ctt-babylon 0.8.8 → 0.8.10

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.
@@ -138,18 +138,19 @@ class BabylonLinkTypeDirective {
138
138
  }
139
139
  handleAnchorLink(sectionId) {
140
140
  if (isPlatformBrowser(this.platformId)) {
141
- const element = document.getElementById(sectionId);
142
- if (element) {
143
- const yOffset = -160;
144
- const y = element.getBoundingClientRect().top +
145
- window.scrollY +
146
- yOffset;
147
- window.scrollTo({ top: y, behavior: 'smooth' });
148
- this.anchorClicked.emit();
141
+ const lang = this.siteSvc.selectedLanguageInstant?.locate.toLowerCase();
142
+ if (this.hasComplexLinks && this.router.url !== `/${lang}`) {
143
+ this.redirectToHomeAnchor(sectionId);
149
144
  }
150
145
  else {
151
- if (this.hasComplexLinks) {
152
- this.redirectToHomeAnchor(sectionId);
146
+ const element = document.getElementById(sectionId);
147
+ if (element) {
148
+ const yOffset = -160;
149
+ const y = element.getBoundingClientRect().top +
150
+ window.scrollY +
151
+ yOffset;
152
+ window.scrollTo({ top: y, behavior: 'smooth' });
153
+ this.anchorClicked.emit();
153
154
  }
154
155
  else {
155
156
  console.warn(`Section with ID ${sectionId} not found.`);
@@ -226,20 +227,22 @@ class BabylonLinkTypeDirective {
226
227
  const intervalMs = 50;
227
228
  let intervalId;
228
229
  this.router.navigateByUrl('/').then(() => {
229
- const attemptScroll = () => {
230
- const element = document.getElementById(sectionId);
231
- if (element) {
230
+ setTimeout(() => {
231
+ const attemptScroll = () => {
232
+ const element = document.getElementById(sectionId);
233
+ if (element) {
234
+ clearInterval(intervalId);
235
+ clearTimeout(timeoutId);
236
+ this.scrollToSection(sectionId);
237
+ }
238
+ };
239
+ intervalId = setInterval(attemptScroll, intervalMs);
240
+ const timeoutId = setTimeout(() => {
232
241
  clearInterval(intervalId);
233
- clearTimeout(timeoutId);
234
- this.scrollToSection(sectionId);
235
- }
236
- };
237
- intervalId = setInterval(attemptScroll, intervalMs);
238
- const timeoutId = setTimeout(() => {
239
- clearInterval(intervalId);
240
- console.warn(`Section with ID ${sectionId} not found.`);
241
- }, 3000);
242
- attemptScroll();
242
+ console.warn(`Section with ID ${sectionId} not found.`);
243
+ }, 3000);
244
+ attemptScroll();
245
+ }, 300);
243
246
  });
244
247
  }
245
248
  scrollToSection(sectionId) {
@@ -2559,6 +2562,7 @@ class MapperService {
2559
2562
  },
2560
2563
  },
2561
2564
  rooms: props?.rooms
2565
+ ?.filter((room, index, self) => self.findIndex((r) => r.id === room.id) === index)
2562
2566
  ?.map((item) => ({
2563
2567
  buttons: Utils.mapButtons(item?.buttons?.slice().reverse()),
2564
2568
  links: Utils.mapButtons(item?.links),