Use + when having more than 99 notifications

pull/5615/head
Chocobozzz 2023-02-13 14:25:16 +01:00
parent 166311358d
commit 587aa74ac3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 8 additions and 3 deletions

View File

@ -1,15 +1,20 @@
<ng-template #notificationNumber>
<div *ngIf="unreadNotifications > 0 && unreadNotifications < 100" class="unread-notifications">{{ unreadNotifications }}</div>
<div *ngIf="unreadNotifications >= 100" class="unread-notifications">99+</div>
</ng-template>
<div
[ngbPopover]="popContent" autoClose="outside" placement="bottom" container={this} popoverClass="popover-notifications"
i18n-title title="View your notifications" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }"
#popover="ngbPopover" (shown)="onPopoverShown()" (hidden)="onPopoverHidden()"
>
<div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div>
<ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
<my-global-icon iconName="bell"></my-global-icon>
</div>
<div *ngIf="isInMobileView" i18n-title title="View your notifications" class="notification-inbox-link">
<div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div>
<ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
<a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)">
<my-global-icon iconName="bell"></my-global-icon>

View File

@ -38,7 +38,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
this.userNotificationService.countUnreadNotifications()
.subscribe({
next: result => {
this.unreadNotifications = Math.min(result, 99) // Limit number to 99
this.unreadNotifications = 102
this.subscribeToNotifications()
},