aboutsummaryrefslogtreecommitdiff
path: root/src/services/notification_utils
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-01-11 02:40:17 +0300
committerHenry Jameson <me@hjkos.com>2019-01-11 02:40:17 +0300
commitef2585e32b546722f2157bd6203701deb495d2e9 (patch)
tree57c0b051fe061643c0583da521cfc8a89fb45a28 /src/services/notification_utils
parent1fb9ceb59bf0dca5f755f5988f90bdd24a89dd53 (diff)
Remove all explicit and implicit conversions of statusId to number, changed
explicit ones so that they convert them to string
Diffstat (limited to 'src/services/notification_utils')
-rw-r--r--src/services/notification_utils/notification_utils.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
index f5ac0d47..c6782af4 100644
--- a/src/services/notification_utils/notification_utils.js
+++ b/src/services/notification_utils/notification_utils.js
@@ -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))
}