diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html index bd00c9411f2..231d0e092ea 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html @@ -8,7 +8,7 @@ - + 0" class="file-section"> diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts index 2e290bfffa5..b881590f4bf 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts @@ -1,4 +1,4 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; @@ -13,6 +13,7 @@ import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service import { SearchResult } from '../../../search/models/search-result.model'; import { Context } from '../../../../core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { hasValue } from '../../../empty.util'; /** * This component show metadata for the given item object in the detail view. @@ -23,7 +24,7 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; templateUrl: './item-detail-preview.component.html', animations: [fadeInOut] }) -export class ItemDetailPreviewComponent { +export class ItemDetailPreviewComponent implements OnChanges { /** * The item to display */ @@ -62,6 +63,12 @@ export class ItemDetailPreviewComponent { ) { } + ngOnChanges(changes: SimpleChanges): void { + if (hasValue(changes.item)) { + this.bitstreams$ = this.getFiles(); + } + } + /** * Perform bitstream download */