@@ -20,7 +20,10 @@ import {
2020 BehaviorSubject ,
2121 Observable ,
2222} from 'rxjs' ;
23- import { map } from 'rxjs/operators' ;
23+ import {
24+ distinctUntilChanged ,
25+ map ,
26+ } from 'rxjs/operators' ;
2427
2528import { ObjectCacheService } from '../../../core/cache/object-cache.service' ;
2629import { EntityTypeDataService } from '../../../core/data/entity-type-data.service' ;
@@ -40,6 +43,7 @@ import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.c
4043import { NotificationsService } from '../../../shared/notifications/notifications.service' ;
4144import { followLink } from '../../../shared/utils/follow-link-config.model' ;
4245import { VarDirective } from '../../../shared/utils/var.directive' ;
46+ import { compareArraysUsingIds } from '../../simple/item-types/shared/item-relationships-utils' ;
4347import { AbstractItemUpdateComponent } from '../abstract-item-update/abstract-item-update.component' ;
4448import { EditItemRelationshipsService } from './edit-item-relationships.service' ;
4549import { EditRelationshipListComponent } from './edit-relationship-list/edit-relationship-list.component' ;
@@ -105,10 +109,10 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent {
105109
106110 const label = this . item . firstMetadataValue ( 'dspace.entity.type' ) ;
107111 if ( label !== undefined ) {
108- this . relationshipTypes$ = this . relationshipTypeService . searchByEntityType ( label , true , true , ...this . getRelationshipTypeFollowLinks ( ) )
109- . pipe (
110- map ( ( relationshipTypes : PaginatedList < RelationshipType > ) => relationshipTypes . page ) ,
111- ) ;
112+ this . relationshipTypes$ = this . relationshipTypeService . searchByEntityType ( label , true , true , ...this . getRelationshipTypeFollowLinks ( ) ) . pipe (
113+ map ( ( relationshipTypes : PaginatedList < RelationshipType > ) => relationshipTypes . page ) ,
114+ distinctUntilChanged ( compareArraysUsingIds ( ) ) ,
115+ ) ;
112116
113117 this . entityTypeService . getEntityTypeByLabel ( label ) . pipe (
114118 getFirstSucceededRemoteData ( ) ,
0 commit comments