Skip to content

Commit

Permalink
Merge pull request #2856 from 4Science/coar-notify-itempage-error-on-…
Browse files Browse the repository at this point in the history
…ldnenabled-false

fix 'undefined' error on anonymous item page landing
  • Loading branch information
tdonohue authored Mar 6, 2024
2 parents 230055c + e6389a7 commit a9c58a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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 { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, PLATFORM
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 @@ export class ItemPageComponent implements OnInit, OnDestroy {
switchMap((coarLdnEnabled: boolean) => {
if (coarLdnEnabled) {
return this.notifyInfoService.getCoarLdnLocalInboxUrls();
} else {
return of([]);
}
})
);
Expand Down

0 comments on commit a9c58a1

Please sign in to comment.