mirror of https://github.com/Chocobozzz/PeerTube
Use + when having more than 99 notifications
parent
166311358d
commit
587aa74ac3
|
@ -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>
|
||||
|
|
|
@ -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()
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue