Merge branch 'switch-to-string-ids' into favorites
with some changes/merge conflicts resolution * switch-to-string-ids: fixx????? fix notifications? fix lint fix tests, removed one unused function, fix real problem that tests helped to surface added some more explicit to string conversion since BE seem to be sending numbers and it could cause an issue. 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:
commit
5251de317d
8 changed files with 71 additions and 82 deletions
|
@ -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.action.id > b.action.id ? -1 : 1)
|
||||
sortedNotifications = sortBy(sortedNotifications, 'seen')
|
||||
return sortedNotifications.filter((notification) => visibleTypes(store).includes(notification.type))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue