]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/users/user-notifications.component.ts
Fix mark all as read notifications
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / users / user-notifications.component.ts
index 3c9eb369d3c54b0268b611cd4ada48c2e73735e9..977dd8925c80eea6db5703f7eb7f21d00f41ef7c 100644 (file)
@@ -15,6 +15,7 @@ export class UserNotificationsComponent implements OnInit {
   @Input() ignoreLoadingBar = false
   @Input() infiniteScroll = true
   @Input() itemsPerPage = 20
+  @Input() markAllAsReadSubject: Subject<boolean>
 
   @Output() notificationsLoaded = new EventEmitter()
 
@@ -40,6 +41,10 @@ export class UserNotificationsComponent implements OnInit {
     }
 
     this.loadMoreNotifications()
+
+    if (this.markAllAsReadSubject) {
+      this.markAllAsReadSubject.subscribe(() => this.markAllAsRead())
+    }
   }
 
   loadMoreNotifications () {