This commit is contained in:
Henry Jameson 2018-08-18 13:41:23 +03:00
parent 23a1000298
commit 0b6f9c62a1

View file

@ -270,8 +270,8 @@ const addNewNotifications = (state, { dispatch, notifications, older }) => {
const allStatuses = state.allStatuses const allStatuses = state.allStatuses
const allStatusesObject = state.allStatusesObject const allStatusesObject = state.allStatusesObject
each(notifications, (notification) => { each(notifications, (notification) => {
const action = notification.notice const result = mergeOrAdd(allStatuses, allStatusesObject, notification.notice)
mergeOrAdd(allStatuses, allStatusesObject, action) const action = result.item
// Only add a new notification if we don't have one for the same action // Only add a new notification if we don't have one for the same action
if (!find(state.notifications.data, (oldNotification) => oldNotification.action.id === action.id)) { if (!find(state.notifications.data, (oldNotification) => oldNotification.action.id === action.id)) {
state.notifications.maxId = Math.max(notification.id, state.notifications.maxId) state.notifications.maxId = Math.max(notification.id, state.notifications.maxId)