diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index c607d114edb..20847d3c75d 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -92,25 +92,25 @@ export class SidebarSearchListElementComponent, K exte }), ); } - + getHierarchicalName(): Observable { return this.getParentTitle().pipe( switchMap((parentTitle: string) => { - return this.getParent().pipe( - switchMap((parentRD: RemoteData) => { - if (hasValue(parentRD) && hasValue(parentRD.payload)) { - const parentInstance = this.createInstanceFromDSpaceObject(parentRD.payload); - return parentInstance.getHierarchicalName().pipe( - map((ancestorName: string) => ancestorName ? `${ancestorName} > ${parentTitle}` : parentTitle) - ); - } - return observableOf(parentTitle); - }) - ); - }) + return this.getParent().pipe( + switchMap((parentRD: RemoteData) => { + if (hasValue(parentRD) && hasValue(parentRD.payload)) { + const parentInstance = this.createInstanceFromDSpaceObject(parentRD.payload); + return parentInstance.getHierarchicalName().pipe( + map((ancestorName: string) => ancestorName ? `${ancestorName} > ${parentTitle}` : parentTitle), + ); + } + return observableOf(parentTitle); + }), + ); + }), ); } - + /** * Utility method to create an instance of the current class from a DSpaceObject */