Fix intersaction Observer in app, communities and learn-how.

This commit is contained in:
Konstantinos Triantafyllou 2023-07-17 12:41:32 +03:00
parent a03d41be9c
commit 6920159b10
4 changed files with 8 additions and 6 deletions

View File

@ -524,8 +524,7 @@ export class AppComponent implements OnInit, OnDestroy {
restrictedData ? "" : "/myCommunities", false, [], [], {}));
}
this.showMenu = true;
// if (typeof document !== "undefined" && this.bottom) {
if (typeof document !== "undefined" && properties && this.isClient && this.showMenu) {
if (typeof IntersectionObserver !== "undefined") {
setTimeout(() => {
this.createObservers();
});

View File

@ -92,7 +92,8 @@ export class CommunitiesComponent implements OnInit, OnDestroy, AfterViewInit {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
} else if (subscription instanceof IntersectionObserver || subscription instanceof MutationObserver) {
} else if ((typeof MutationObserver != 'undefined' && subscription instanceof MutationObserver) ||
(typeof IntersectionObserver != 'undefined' && subscription instanceof IntersectionObserver)) {
subscription.disconnect();
}
});
@ -100,7 +101,7 @@ export class CommunitiesComponent implements OnInit, OnDestroy, AfterViewInit {
}
ngAfterViewInit() {
if(typeof window !== "undefined") {
if(typeof IntersectionObserver !== "undefined" && typeof MutationObserver !== "undefined") {
this.createObservers();
}
}

View File

@ -279,12 +279,14 @@ export class LearnHowComponent implements OnInit {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
} else if(typeof IntersectionObserver !== 'undefined' && subscription instanceof IntersectionObserver) {
subscription.disconnect();
}
});
}
ngAfterViewInit() {
if (typeof window !== "undefined") {
if (typeof IntersectionObserver !== "undefined") {
this.createObservers();
}
}

@ -1 +1 @@
Subproject commit 2f989107123ae674aba4907b113e4498a8f87786
Subproject commit 4700cc82c866ed86158234f706fc52360bc34637