w2p-86403 prevent from displaying on pages where rss feed doesn't make sense

This commit is contained in:
Nathan Buckingham
2022-05-04 15:27:10 -04:00
parent 8785270363
commit 6cd22fa004
2 changed files with 12 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
<ng-container *ngIf="isEnabled$ | async">
<ng-container *ngIf="(isEnabled$ | async) && (hasRoute('home') || hasRoute('search') || hasRoute('collections') || hasRoute('community'))">
<div *ngIf="route$ | async as route" class="d-inline-block float-right margin-right">
<a [href]="route" class="btn btn-secondary"><i class="fas fa-rss-square"></i></a>
</div>

View File

@@ -120,6 +120,17 @@ export class RSSComponent implements OnInit, OnDestroy {
return route;
}
/**
* Check if the router url contains the specified route
*
* @param {string} route
* @returns
* @memberof MyComponent
*/
hasRoute(route: string) {
return this.router.url.includes(route);
}
/**
* Creates <link> tags in the header of the page
* @param route The composed url to opensearch