diff --git a/src/app/item-page/versions/item-versions.component.ts b/src/app/item-page/versions/item-versions.component.ts
index afb74b0ecca..fbba2ca541f 100644
--- a/src/app/item-page/versions/item-versions.component.ts
+++ b/src/app/item-page/versions/item-versions.component.ts
@@ -719,11 +719,29 @@ export class ItemVersionsComponent implements OnInit {
getFirstSucceededRemoteListPayload())
.subscribe((itemList: Item[]) => {
this.nameCache[handle] = this.dsoNameService.getName(itemList?.[0]);
+ this.updateVersionsFromMetadata(handle, this.nameCache[handle]);
});
}
return this.nameCache[handle];
}
+ /**
+ * Update the name in the `versionsFromMetadata` for the current record with matching handle.
+ *
+ * @param handle of the record which will be updated
+ * @param name of the version record
+ */
+ updateVersionsFromMetadata(handle: string, name: string) {
+ const versionsCopy = this.versionsFromMetadata.value;
+ versionsCopy.forEach((versionFromMetadata: RelationNameHandle) => {
+ if (!isEqual(versionFromMetadata.handle, handle)) {
+ return;
+ }
+ versionFromMetadata.name = name;
+ });
+ this.versionsFromMetadata.next(versionsCopy);
+ }
+
ngOnDestroy(): void {
this.cleanupSubscribes();
this.paginationService.clearPagination(this.options.id);