Accessibility fixes for #2149
[oweals/peertube.git] / client / src / app / +my-account / my-account-notifications / my-account-notifications.component.ts
index 3e197088dc4211d4829e49e8f96d25fe0e1fb114..a50cb0fb94f60d7b6c819163fadaa7f5334cc519 100644 (file)
@@ -6,9 +6,13 @@ import { UserNotificationsComponent } from '@app/shared'
   styleUrls: [ './my-account-notifications.component.scss' ]
 })
 export class MyAccountNotificationsComponent {
-  @ViewChild('userNotification') userNotification: UserNotificationsComponent
+  @ViewChild('userNotification', { static: true }) userNotification: UserNotificationsComponent
 
   markAllAsRead () {
     this.userNotification.markAllAsRead()
   }
+
+  hasUnreadNotifications () {
+    return this.userNotification.notifications.filter(n => n.read === false).length !== 0
+  }
 }