Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use + when having more than 99 notifications

Chocobozzz587aa74ac3d8
diff --git a/client/src/app/menu/notification.component.html b/client/src/app/menu/notification.component.html
index 890b086f1f..7a62800f5d 100644
--- a/client/src/app/menu/notification.component.html
+++ b/client/src/app/menu/notification.component.html
@@ -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>
diff --git a/client/src/app/menu/notification.component.ts b/client/src/app/menu/notification.component.ts
index ac9c799915..dc88d5a3c3 100644
--- a/client/src/app/menu/notification.component.ts
+++ b/client/src/app/menu/notification.component.ts
@@ -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()
},