diff options
| author | Henry Jameson <me@hjkos.com> | 2019-01-16 17:30:47 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-01-16 17:30:47 +0300 |
| commit | 7d157203392adcbd9752db05d259d5dc32aa19a0 (patch) | |
| tree | f403d0bad9bcdca3d79b923f803fc93a94a51ac3 /src | |
| parent | 22e0686395de023eb4c26b94be11954fc4803331 (diff) | |
fix notifications?
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/statuses.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index f90b0ed3..84f65258 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -297,9 +297,12 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot // Only add a new notification if we don't have one for the same action // TODO: this technically works but should be checking for notification.id, not action.id i think if (!find(state.notifications.data, (oldNotification) => oldNotification.action.id === action.id)) { - // TODO: adapt to "what if notification ids are not actually numbers" - state.notifications.maxId = Math.max(notification.id, state.notifications.maxId) - state.notifications.minId = Math.min(notification.id, state.notifications.minId) + state.notifications.maxId = notification.id > state.notifications.maxId + ? notification.id + : state.notifications.maxId + state.notifications.minId = notification.id < state.notifications.minId + ? notification.id + : state.notifications.minId const fresh = !notification.is_seen const status = notification.ntype === 'like' |
