Remove all explicit and implicit conversions of statusId to number, changed

explicit ones so that they convert them to string
This commit is contained in:
Henry Jameson 2019-01-11 02:40:17 +03:00
parent 1fb9ceb59b
commit ef2585e32b
5 changed files with 15 additions and 13 deletions

View file

@ -10,8 +10,8 @@ export const visibleTypes = store => ([
].filter(_ => _))
export const visibleNotificationsFromStore = store => {
// Don't know why, but sortBy([seen, -action.id]) doesn't work.
let sortedNotifications = sortBy(notificationsFromStore(store), ({action}) => -action.id)
// map is just to clone the array since sort mutates it and it causes some issues
let sortedNotifications = notificationsFromStore(store).map(_ => _).sort((a, b) => a.id > b.id ? -1 : 1)
sortedNotifications = sortBy(sortedNotifications, 'seen')
return sortedNotifications.filter((notification) => visibleTypes(store).includes(notification.type))
}