From ac70b8c2605005c43eb32631954b1b6f8486e28d Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 9 Aug 2022 12:31:57 +0300 Subject: [PATCH] [Library | new-theme]: resultLanding.component.ts: [Bug fix] Added check if "resultLandingInfo.hostedBy_collectedFrom" is initialized | dropdown-filter.component.ts: [Bug fix] In method "isOpen()" added check if in client side. --- landingPages/result/resultLanding.component.ts | 4 ++-- utils/dropdown-filter/dropdown-filter.component.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 30a2a68c..f7e081cb 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -793,9 +793,9 @@ export class ResultLandingComponent { || (resultLandingInfo.description && resultLandingInfo.description[0] && this.hasKeyword(resultLandingInfo.description[0],abstract_words)) ) && ((resultLandingInfo.publisher && resultLandingInfo.publisher.toLowerCase() == "zenodo") || - resultLandingInfo.hostedBy_collectedFrom.filter(value => { + (resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.filter(value => { return value.downloadNames && value.downloadNames.filter(name => {return name && name.toLowerCase().indexOf("zenodo") != 1}).length > 0 - }).length > 0)); + }).length > 0))); // console.log("spam content " + allow) //common titles/ description / authors let common_titles = ["introduction", "editorial", "book reviews", "preface", "reviews", "none", "book review", "foreword", "conclusion", "review", "reply","einleitung","short notices","erratum","discussion", "letters to the editor","letter to the editor","reviews of books",":{unav)","editorial board"]; diff --git a/utils/dropdown-filter/dropdown-filter.component.ts b/utils/dropdown-filter/dropdown-filter.component.ts index b2565f9b..a780286a 100644 --- a/utils/dropdown-filter/dropdown-filter.component.ts +++ b/utils/dropdown-filter/dropdown-filter.component.ts @@ -36,7 +36,7 @@ export class DropdownFilterComponent { @ViewChild("dropdownElement") dropdownElement: ElementRef; get isOpen() { - return this.dropdownElement && UIkit.dropdown(this.dropdownElement.nativeElement).isActive(); + return (typeof document !== 'undefined') && this.dropdownElement && UIkit.dropdown(this.dropdownElement.nativeElement).isActive(); } closeDropdown() {