diff --git a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html index 5886cc576d..bb71c9208f 100644 --- a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html +++ b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html @@ -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" > diff --git a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts index 8aac0518fd..4320fd95c2 100644 --- a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts +++ b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts @@ -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,