add basic validation for statusless status notifications
This commit is contained in:
parent
59db4582b0
commit
cd2f5ced31
3 changed files with 30 additions and 7 deletions
|
@ -22,6 +22,13 @@ const statusNotifications = ['like', 'mention', 'repeat', 'pleroma:emoji_reactio
|
|||
|
||||
export const isStatusNotification = (type) => includes(statusNotifications, type)
|
||||
|
||||
export const isValidNotification = (notification) => {
|
||||
if (isStatusNotification(notification.type) && !notification.status) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const sortById = (a, b) => {
|
||||
const seqA = Number(a.id)
|
||||
const seqB = Number(b.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue