From 83f31b8a00613a576ea17c5867f2840788b5f1dd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 27 Sep 2020 14:33:21 -0500 Subject: [PATCH] Notifications: parseInt ID when sorting --- app/soapbox/reducers/notifications.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/soapbox/reducers/notifications.js b/app/soapbox/reducers/notifications.js index 7dbda2c64..3d0d14dfb 100644 --- a/app/soapbox/reducers/notifications.js +++ b/app/soapbox/reducers/notifications.js @@ -32,8 +32,9 @@ const initialState = ImmutableMap({ // For sorting the notifications const comparator = (a, b) => { - if (a.get('id') < b.get('id')) return 1; - if (a.get('id') > b.get('id')) return -1; + const parse = m => parseInt(m.get('id'), 10); + if (parse(a) < parse(b)) return 1; + if (parse(a) > parse(b)) return -1; return 0; };