mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Sorted notifications after concatenation by Roberts suggestion
This commit is contained in:
parent
a57d228c40
commit
1f8cc9ef15
@ -125,7 +125,15 @@ export default {
|
||||
const newNotifications = data.notifications.filter(newN => {
|
||||
return !this.displayedNotifications.find(oldN => this.equalNotification(newN, oldN))
|
||||
})
|
||||
this.displayedNotifications = newNotifications.concat(this.displayedNotifications)
|
||||
this.displayedNotifications = newNotifications
|
||||
.concat(this.displayedNotifications)
|
||||
.sort((a, b) => {
|
||||
return a.createdAt === b.createdAt
|
||||
? 0
|
||||
: new Date(a.createdAt) < new Date(b.createdAt)
|
||||
? 1
|
||||
: -1
|
||||
})
|
||||
this.updateOn = false
|
||||
return data.notifications
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user