diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2d1bb0b..ef485d0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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(); }); diff --git a/src/app/communities/communities.component.ts b/src/app/communities/communities.component.ts index ad7b2ed..6ecac7a 100644 --- a/src/app/communities/communities.component.ts +++ b/src/app/communities/communities.component.ts @@ -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(); } } diff --git a/src/app/learn-how/learn-how.component.ts b/src/app/learn-how/learn-how.component.ts index 906f7fb..89a2e1f 100644 --- a/src/app/learn-how/learn-how.component.ts +++ b/src/app/learn-how/learn-how.component.ts @@ -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(); } } diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 2f98910..4700cc8 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 2f989107123ae674aba4907b113e4498a8f87786 +Subproject commit 4700cc82c866ed86158234f706fc52360bc34637