feat: 🎸 Notifications sorted by modified, then created date (#151)
This commit is contained in:
parent
4a0841a704
commit
91f63e8d2a
|
@ -26,5 +26,11 @@ export const notification = ({
|
|||
type,
|
||||
})
|
||||
|
||||
const notificationsSort = (item1: Notification, item2: Notification): number => {
|
||||
const m1 = item1.dateModified || item1.dateCreated
|
||||
const m2 = item2.dateModified || item2.dateCreated
|
||||
return m1 < m2 ? 1 : -1
|
||||
}
|
||||
|
||||
export const notifications = (data: any): Notification[] =>
|
||||
etjanst(data).map(notification)
|
||||
etjanst(data).map(notification).sort(notificationsSort)
|
||||
|
|
Loading…
Reference in New Issue