Skip to content

Commit a9c58a1

Browse files
authored
Merge pull request #2856 from 4Science/coar-notify-itempage-error-on-ldnenabled-false
fix 'undefined' error on anonymous item page landing
2 parents 230055c + e6389a7 commit a9c58a1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/app/item-page/edit-item-page/edit-item-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="col-12">
44
<h1 class="border-bottom">{{'item.edit.head' | translate}}</h1>
55
<div class="pt-2">
6-
<ul class="nav nav-tabs justify-content-start" role="tablist">
6+
<ul *ngIf="pages.length > 0" class="nav nav-tabs justify-content-start" role="tablist">
77
<li *ngFor="let page of pages" class="nav-item" role="presentation">
88
<a *ngIf="(page.enabled | async)"
99
[attr.aria-selected]="page.page === currentPage"

src/app/item-page/simple/item-page.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, PLATFORM
22
import { ActivatedRoute, Router } from '@angular/router';
33
import { isPlatformServer } from '@angular/common';
44

5-
import { Observable, combineLatest } from 'rxjs';
5+
import { Observable, combineLatest, of } from 'rxjs';
66
import { map, switchMap, take } from 'rxjs/operators';
77

88
import { ItemDataService } from '../../core/data/item-data.service';
@@ -155,6 +155,8 @@ export class ItemPageComponent implements OnInit, OnDestroy {
155155
switchMap((coarLdnEnabled: boolean) => {
156156
if (coarLdnEnabled) {
157157
return this.notifyInfoService.getCoarLdnLocalInboxUrls();
158+
} else {
159+
return of([]);
158160
}
159161
})
160162
);

0 commit comments

Comments
 (0)