fix notifications?
This commit is contained in:
parent
22e0686395
commit
7d15720339
1 changed files with 6 additions and 3 deletions
|
@ -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
|
// 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
|
// 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)) {
|
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 = notification.id > state.notifications.maxId
|
||||||
state.notifications.maxId = Math.max(notification.id, state.notifications.maxId)
|
? notification.id
|
||||||
state.notifications.minId = Math.min(notification.id, state.notifications.minId)
|
: state.notifications.maxId
|
||||||
|
state.notifications.minId = notification.id < state.notifications.minId
|
||||||
|
? notification.id
|
||||||
|
: state.notifications.minId
|
||||||
|
|
||||||
const fresh = !notification.is_seen
|
const fresh = !notification.is_seen
|
||||||
const status = notification.ntype === 'like'
|
const status = notification.ntype === 'like'
|
||||||
|
|
Loading…
Reference in a new issue