aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-02-13 14:25:16 +0100
committerChocobozzz <me@florianbigard.com>2023-02-13 14:25:16 +0100
commit587aa74ac3d8f2e1fdd8754d60c7a8c38ce30b88 (patch)
tree8a581c58c18045afe2ff550fb95b569684bcbb85
parent166311358d82657a15520ef35cd99e4fb82ed56f (diff)
downloadPeerTube-587aa74ac3d8f2e1fdd8754d60c7a8c38ce30b88.tar.gz
PeerTube-587aa74ac3d8f2e1fdd8754d60c7a8c38ce30b88.tar.zst
PeerTube-587aa74ac3d8f2e1fdd8754d60c7a8c38ce30b88.zip
Use + when having more than 99 notifications
-rw-r--r--client/src/app/menu/notification.component.html9
-rw-r--r--client/src/app/menu/notification.component.ts2
2 files changed, 8 insertions, 3 deletions
diff --git a/client/src/app/menu/notification.component.html b/client/src/app/menu/notification.component.html
index 890b086f1..7a62800f5 100644
--- a/client/src/app/menu/notification.component.html
+++ b/client/src/app/menu/notification.component.html
@@ -1,15 +1,20 @@
1<ng-template #notificationNumber>
2 <div *ngIf="unreadNotifications > 0 && unreadNotifications < 100" class="unread-notifications">{{ unreadNotifications }}</div>
3 <div *ngIf="unreadNotifications >= 100" class="unread-notifications">99+</div>
4</ng-template>
5
1<div 6<div
2 [ngbPopover]="popContent" autoClose="outside" placement="bottom" container={this} popoverClass="popover-notifications" 7 [ngbPopover]="popContent" autoClose="outside" placement="bottom" container={this} popoverClass="popover-notifications"
3 i18n-title title="View your notifications" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }" 8 i18n-title title="View your notifications" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }"
4 #popover="ngbPopover" (shown)="onPopoverShown()" (hidden)="onPopoverHidden()" 9 #popover="ngbPopover" (shown)="onPopoverShown()" (hidden)="onPopoverHidden()"
5> 10>
6 <div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div> 11 <ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
7 12
8 <my-global-icon iconName="bell"></my-global-icon> 13 <my-global-icon iconName="bell"></my-global-icon>
9</div> 14</div>
10 15
11<div *ngIf="isInMobileView" i18n-title title="View your notifications" class="notification-inbox-link"> 16<div *ngIf="isInMobileView" i18n-title title="View your notifications" class="notification-inbox-link">
12 <div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div> 17 <ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
13 18
14 <a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)"> 19 <a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)">
15 <my-global-icon iconName="bell"></my-global-icon> 20 <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 ac9c79991..dc88d5a3c 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 {
38 this.userNotificationService.countUnreadNotifications() 38 this.userNotificationService.countUnreadNotifications()
39 .subscribe({ 39 .subscribe({
40 next: result => { 40 next: result => {
41 this.unreadNotifications = Math.min(result, 99) // Limit number to 99 41 this.unreadNotifications = 102
42 this.subscribeToNotifications() 42 this.subscribeToNotifications()
43 }, 43 },
44 44