]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/users/user-notifications.component.ts
Fix mention notification with deleted comment
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / users / user-notifications.component.ts
index 48be80e3f37f4934f76e8bb18f7ece64339f7c34..387c49d94ee0c4bd2e0ecf458e691d496eed9b27 100644 (file)
@@ -1,7 +1,7 @@
 import { Subject } from 'rxjs'
 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
 import { ComponentPagination, hasMoreItems, Notifier } from '@app/core'
-import { UserNotificationType } from '@shared/models'
+import { UserNotificationType, AbuseState } from '@shared/models'
 import { UserNotification } from './user-notification.model'
 import { UserNotificationService } from './user-notification.service'
 
@@ -53,6 +53,7 @@ export class UserNotificationsComponent implements OnInit {
       ignoreLoadingBar: this.ignoreLoadingBar,
       sort: {
         field: this.sortField,
+        // if we order by creation date, we want DESC. all other fields are ASC (like unread).
         order: this.sortField === 'createdAt' ? -1 : 1
       }
     })
@@ -115,4 +116,8 @@ export class UserNotificationsComponent implements OnInit {
     this.sortField = column
     this.loadNotifications(true)
   }
+
+  isAccepted (notification: UserNotification) {
+    return notification.abuse.state === AbuseState.ACCEPTED
+  }
 }