Turn any count larger 99 to 99+

pull/10718/head
Oliver Günther 2 years ago
parent 5406045d94
commit f581ef8eb5
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 2
      frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
  2. 16
      frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts

@ -9,7 +9,7 @@
*ngIf="unreadCount !== 0"
class="op-ian-bell--indicator"
data-qa-selector="op-ian-notifications-count"
[textContent]="(unreadCount === -1 || unreadCount > 99) ? '' : unreadCount"
[textContent]="unreadCountText$ | async"
></span>
</ng-container>
</a>

@ -43,6 +43,22 @@ export class InAppNotificationBellComponent {
this.polling$,
]).pipe(map(([count]) => count));
unreadCountText$ = this
.unreadCount$
.pipe(
map((count) => {
if (count > 99) {
return '99+';
}
if (count <= 0) {
return '';
}
return count;
}),
);
constructor(
readonly storeService:IanBellService,
readonly apiV3Service:ApiV3Service,

Loading…
Cancel
Save