]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/menu/avatar-notification.component.ts
Reorganize client shared modules
[github/Chocobozzz/PeerTube.git] / client / src / app / menu / avatar-notification.component.ts
index 680129a48a5b10a1df4e23ad661dbf8493a82213..9a64faa6adf90c8a53c83dd4f59f40142ebdc3af 100644 (file)
@@ -1,11 +1,10 @@
+import { Subject, Subscription } from 'rxjs'
+import { filter } from 'rxjs/operators'
 import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
-import { User } from '../shared/users/user.model'
-import { UserNotificationService } from '@app/shared/users/user-notification.service'
-import { Subscription } from 'rxjs'
-import { Notifier, UserNotificationSocket } from '@app/core'
-import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
 import { NavigationEnd, Router } from '@angular/router'
-import { filter } from 'rxjs/operators'
+import { Notifier, User, UserNotificationSocket } from '@app/core'
+import { UserNotificationService } from '@app/shared/shared-main'
+import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
 
 @Component({
   selector: 'my-avatar-notification',
@@ -14,11 +13,14 @@ import { filter } from 'rxjs/operators'
 })
 export class AvatarNotificationComponent implements OnInit, OnDestroy {
   @ViewChild('popover', { static: true }) popover: NgbPopover
+
   @Input() user: User
 
   unreadNotifications = 0
   loaded = false
 
+  markAllAsReadSubject = new Subject<boolean>()
+
   private notificationSub: Subscription
   private routeSub: Subscription
 
@@ -64,7 +66,7 @@ export class AvatarNotificationComponent implements OnInit, OnDestroy {
   }
 
   markAllAsRead () {
-    this.userNotificationService.markAllAsRead()
+    this.markAllAsReadSubject.next(true)
   }
 
   private async subscribeToNotifications () {