Skip to content

Commit fe3a7d6

Browse files
authored
Merge pull request DSpace#4812 from atmire/fix-embargo-status-badge-contribute-9.0
135574: Fix embargo status badge not showing up on refresh
2 parents db0913f + c580c1f commit fe3a7d6

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,8 @@ export class AccessStatusBadgeComponent implements OnDestroy, OnInit {
129129
map((accessStatus: AccessStatusObject) => hasValue(accessStatus.embargoDate) ? accessStatus.embargoDate : null),
130130
catchError(() => of(null)),
131131
);
132-
this.subs.push(
133-
this.embargoDate$.pipe().subscribe((embargoDate: string) => {
134-
if (hasValue(embargoDate)) {
135-
this.accessStatus$ = of('embargo.listelement.badge');
136-
}
137-
}),
132+
this.accessStatus$ = this.embargoDate$.pipe(
133+
map(date => hasValue(date) ? 'embargo.listelement.badge' : null),
138134
);
139135
}
140136
}

0 commit comments

Comments
 (0)