Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 'undefined' error on anonymous item page landing #2856

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="col-12">
<h1 class="border-bottom">{{'item.edit.head' | translate}}</h1>
<div class="pt-2">
<ul class="nav nav-tabs justify-content-start" role="tablist">
<ul *ngIf="pages.length > 0" class="nav nav-tabs justify-content-start" role="tablist">
<li *ngFor="let page of pages" class="nav-item" role="presentation">
<a *ngIf="(page.enabled | async)"
[attr.aria-selected]="page.page === currentPage"
Expand Down
4 changes: 3 additions & 1 deletion src/app/item-page/simple/item-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ActivatedRoute, Router } from '@angular/router';
import { isPlatformServer } from '@angular/common';

import { Observable, combineLatest } from 'rxjs';
import { Observable, combineLatest, of } from 'rxjs';
import { map, switchMap, take } from 'rxjs/operators';

import { ItemDataService } from '../../core/data/item-data.service';
Expand Down Expand Up @@ -155,6 +155,8 @@
switchMap((coarLdnEnabled: boolean) => {
if (coarLdnEnabled) {
return this.notifyInfoService.getCoarLdnLocalInboxUrls();
} else {
return of([]);

Check warning on line 159 in src/app/item-page/simple/item-page.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L159 was not covered by tests
}
})
);
Expand Down
Loading