Browse Source

UI: Fixed show notification counter

pull/8424/head
Vladyslav_Prykhodko 3 years ago
parent
commit
d84af4cc35
  1. 3
      ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts

3
ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts

@ -25,7 +25,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { NotificationWebsocketService } from '@core/ws/notification-websocket.service'; import { NotificationWebsocketService } from '@core/ws/notification-websocket.service';
import { BehaviorSubject, ReplaySubject, Subscription } from 'rxjs'; import { BehaviorSubject, ReplaySubject, Subscription } from 'rxjs';
import { distinctUntilChanged, share, tap } from 'rxjs/operators'; import { distinctUntilChanged, map, share, tap } from 'rxjs/operators';
import { MatButton } from '@angular/material/button'; import { MatButton } from '@angular/material/button';
import { TbPopoverService } from '@shared/components/popover.service'; import { TbPopoverService } from '@shared/components/popover.service';
import { ShowNotificationPopoverComponent } from '@home/components/notification/show-notification-popover.component'; import { ShowNotificationPopoverComponent } from '@home/components/notification/show-notification-popover.component';
@ -47,6 +47,7 @@ export class NotificationBellComponent implements OnDestroy {
count$ = this.countSubject.asObservable().pipe( count$ = this.countSubject.asObservable().pipe(
distinctUntilChanged(), distinctUntilChanged(),
map((value) => value >= 100 ? '99+' : value),
tap(() => setTimeout(() => this.cd.markForCheck())), tap(() => setTimeout(() => this.cd.markForCheck())),
share({ share({
connector: () => new ReplaySubject(1) connector: () => new ReplaySubject(1)

Loading…
Cancel
Save