From 0d4cf0d1c8d9dd025a9a86e803ac3d2441077561 Mon Sep 17 00:00:00 2001 From: fnecas Date: Fri, 22 Dec 2023 18:13:53 +0100 Subject: [PATCH] fix: moved to init to avoid error if quality widget is not enabled --- .../results-list.container.component.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libs/feature/search/src/lib/results-list/results-list.container.component.ts b/libs/feature/search/src/lib/results-list/results-list.container.component.ts index f14929f2d8..b5771bfb4d 100644 --- a/libs/feature/search/src/lib/results-list/results-list.container.component.ts +++ b/libs/feature/search/src/lib/results-list/results-list.container.component.ts @@ -38,17 +38,7 @@ export class ResultsListContainerComponent implements OnInit { error$: Observable errorCode$: Observable errorMessage$: Observable - pipelineForQualityScoreActivated: Observable = - this.facade.results$.pipe( - tap((records) => { - if (records?.length > 0 && !records[0].extras?.qualityScore) { - console.warn( - 'It looks like the metadata quality indicator is not available on these records, probably due to a missing indexing pipeline' - ) - } - }), - map((records) => !!records[0]?.extras.qualityScore) - ) + pipelineForQualityScoreActivated: Observable errorTypes = ErrorType recordUrlGetter = this.getRecordUrl.bind(this) @@ -71,6 +61,17 @@ export class ResultsListContainerComponent implements OnInit { this.facade.setResultsLayout(this.layout) } + this.pipelineForQualityScoreActivated = this.facade.results$.pipe( + tap((records) => { + if (records?.length > 0 && !records[0].extras?.qualityScore) { + console.warn( + 'It looks like the metadata quality indicator is not available on these records, probably due to a missing indexing pipeline' + ) + } + }), + map((records) => !!records[0]?.extras.qualityScore) + ) + this.error$ = this.facade.error$ this.errorCode$ = this.error$.pipe( filter((error) => error !== null),