Skip to content

Commit 443df71

Browse files
authored
Merge pull request #4820 from DSpace/backport-4812-to-dspace-9_x
[Port dspace-9_x] 135574: Fix embargo status badge not showing up on refresh
2 parents ab52c39 + 2bd3659 commit 443df71

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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
@@ -130,12 +130,8 @@ export class AccessStatusBadgeComponent implements OnDestroy, OnInit {
130130
map((accessStatus: AccessStatusObject) => hasValue(accessStatus.embargoDate) ? accessStatus.embargoDate : null),
131131
catchError(() => of(null)),
132132
);
133-
this.subs.push(
134-
this.embargoDate$.pipe().subscribe((embargoDate: string) => {
135-
if (hasValue(embargoDate)) {
136-
this.accessStatus$ = of('embargo.listelement.badge');
137-
}
138-
}),
133+
this.accessStatus$ = this.embargoDate$.pipe(
134+
map(date => hasValue(date) ? 'embargo.listelement.badge' : null),
139135
);
140136
}
141137
}

0 commit comments

Comments
 (0)