Only display number on badge if there are unread notifications

This commit is contained in:
Clemente Raposo 2023-02-02 11:48:30 +00:00
parent 92a87f571a
commit 4e7e1cb3c8

View file

@ -55,8 +55,12 @@
<button class="alerts-button dropdown-toggle" type="button" aria-label="Toggle Alerts" (mouseenter)="markAsRead()">
<scrm-image class="action-btn-icon" image="alert"></scrm-image>
</button>
<span class="badge badge-position rounded-pill bg-danger text-white">{{notificationCount$ | async }}</span>
<div class="dropdown-menu dropdown-menu-right">
<ng-container *ngIf="(notificationCount$ | async) as notificationCount">
<span *ngIf="(notificationCount ?? false)" class="badge badge-position rounded-pill bg-danger text-white">
<ng-container *ngIf="notificationCount > 0">{{notificationCount }}</ng-container>
</span>
</ng-container>
<div class="dropdown-menu dropdown-menu-right">
<scrm-notifications></scrm-notifications>
</div>
</div>