Skip to content
Snippets Groups Projects
Commit 0ab2f179 authored by Eugenij's avatar Eugenij
Browse files

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.
parent fbe7af3d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment