forked from AkkomaGang/akkoma-fe
Use integer type of notitication ids (avoid redundant casting for getting maxId in addNewNotifications)
This commit is contained in:
parent
0ab2f17991
commit
b62d2c76e5
2 changed files with 3 additions and 4 deletions
|
@ -273,11 +273,10 @@ 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
|
||||||
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
|
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
|
||||||
const notificationId = parseInt(notification.id, 10)
|
state.notifications.maxId = notification.id > state.notifications.maxId
|
||||||
state.notifications.maxId = notificationId > parseInt(state.notifications.maxId, 10)
|
|
||||||
? notification.id
|
? notification.id
|
||||||
: state.notifications.maxId
|
: state.notifications.maxId
|
||||||
state.notifications.minId = notificationId < parseInt(state.notifications.minId, 10)
|
state.notifications.minId = notification.id < state.notifications.minId
|
||||||
? notification.id
|
? notification.id
|
||||||
: state.notifications.minId
|
: state.notifications.minId
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@ export const parseNotification = (data) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
output.created_at = new Date(data.created_at)
|
output.created_at = new Date(data.created_at)
|
||||||
output.id = String(data.id)
|
output.id = data.id
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue