From 6df1ee64f27a844aa4a80118d8fb6000fb298406 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Mon, 2 Aug 2021 09:18:21 +0200 Subject: [PATCH] [DSC-184] Fix issue with mydpsace page that hangs forever on error response --- src/app/my-dspace-page/my-dspace-page.component.html | 4 ++-- src/app/my-dspace-page/my-dspace-page.component.ts | 11 +++++------ src/app/shared/error/error.component.html | 6 +++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/app/my-dspace-page/my-dspace-page.component.html b/src/app/my-dspace-page/my-dspace-page.component.html index 4aadb16255..5a15abcc08 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.html +++ b/src/app/my-dspace-page/my-dspace-page.component.html @@ -4,7 +4,7 @@ = new InjectionToken('searchConfigurationService'); @@ -111,8 +111,7 @@ export class MyDSpacePageComponent implements OnInit { constructor(private service: SearchService, private sidebarService: SidebarService, private windowService: HostWindowService, - @Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: MyDSpaceConfigurationService, - private routeService: RouteService) { + @Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: MyDSpaceConfigurationService) { this.isXsOrSm$ = this.windowService.isXsOrSm(); this.service.setServiceOptions(MyDSpaceResponseParsingService, MyDSpaceRequest); } @@ -134,8 +133,8 @@ export class MyDSpacePageComponent implements OnInit { this.searchOptions$ = this.searchConfigService.paginatedSearchOptions; this.sub = this.searchOptions$.pipe( tap(() => this.resultsRD$.next(null)), - switchMap((options: PaginatedSearchOptions) => this.service.search(options).pipe(getFirstSucceededRemoteData()))) - .subscribe((results) => { + switchMap((options: PaginatedSearchOptions) => this.service.search(options).pipe(getFirstCompletedRemoteData()))) + .subscribe((results: RemoteData>) => { this.resultsRD$.next(results); }); diff --git a/src/app/shared/error/error.component.html b/src/app/shared/error/error.component.html index d41760e258..dd75cb4b1b 100644 --- a/src/app/shared/error/error.component.html +++ b/src/app/shared/error/error.component.html @@ -1,3 +1,3 @@ -
- -
+ + {{ message }} +