Explicitly cast notification ids to integers when using them for setting maxId
This fixes the bug where BE receives incorrect `since_id` when marking notifications as read.
This commit is contained in:
parent
fbe7af3d56
commit
0ab2f17991
1 changed files with 3 additions and 2 deletions
|
@ -273,10 +273,11 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
|
|||
|
||||
// Only add a new notification if we don't have one for the same action
|
||||
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
|
||||
state.notifications.maxId = notification.id > state.notifications.maxId
|
||||
const notificationId = parseInt(notification.id, 10)
|
||||
state.notifications.maxId = notificationId > parseInt(state.notifications.maxId, 10)
|
||||
? notification.id
|
||||
: state.notifications.maxId
|
||||
state.notifications.minId = notification.id < state.notifications.minId
|
||||
state.notifications.minId = notificationId < parseInt(state.notifications.minId, 10)
|
||||
? notification.id
|
||||
: state.notifications.minId
|
||||
|
||||
|
|
Loading…
Reference in a new issue