removed unused masto api, added initial version of interactions timeline

This commit is contained in:
Henry Jameson 2019-05-14 22:38:16 +03:00
parent 2322610b62
commit 543604fd2d
11 changed files with 76 additions and 29 deletions

View file

@ -25,11 +25,13 @@ const sortById = (a, b) => {
}
}
export const visibleNotificationsFromStore = store => {
export const visibleNotificationsFromStore = (store, types) => {
// map is just to clone the array since sort mutates it and it causes some issues
let sortedNotifications = notificationsFromStore(store).map(_ => _).sort(sortById)
sortedNotifications = sortBy(sortedNotifications, 'seen')
return sortedNotifications.filter((notification) => visibleTypes(store).includes(notification.type))
return sortedNotifications.filter(
(notification) => (types || visibleTypes(store)).includes(notification.type)
)
}
export const unseenNotificationsFromStore = store =>