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'
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
}
})
this.sortField = column
this.loadNotifications(true)
}
+
+ isAccepted (notification: UserNotification) {
+ return notification.abuse.state === AbuseState.ACCEPTED
+ }
}