import { User } from '../shared/users/user.model'
import { UserNotificationService } from '@app/shared/users/user-notification.service'
import { Subscription } from 'rxjs'
-import { Notifier } from '@app/core'
+import { Notifier, UserNotificationSocket } from '@app/core'
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
import { NavigationEnd, Router } from '@angular/router'
import { filter } from 'rxjs/operators'
constructor (
private userNotificationService: UserNotificationService,
+ private userNotificationSocket: UserNotificationSocket,
private notifier: Notifier,
private router: Router
) {}
}
private subscribeToNotifications () {
- this.notificationSub = this.userNotificationService.getMyNotificationsSocket()
+ this.notificationSub = this.userNotificationSocket.getMyNotificationsSocket()
.subscribe(data => {
if (data.type === 'new') return this.unreadNotifications++
if (data.type === 'read') return this.unreadNotifications--