From 4cd2d13bd226c005317adf9848f4c0316401b2ff Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 1 Feb 2020 17:53:28 +0100 Subject: [PATCH] When submitting markers, use last displayed notification, not last received one --- app/javascript/flavours/glitch/actions/markers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/actions/markers.js b/app/javascript/flavours/glitch/actions/markers.js index defcb71274c..7ffab404d7b 100644 --- a/app/javascript/flavours/glitch/actions/markers.js +++ b/app/javascript/flavours/glitch/actions/markers.js @@ -9,7 +9,7 @@ export const submitMarkers = () => (dispatch, getState) => { const params = {}; const lastHomeId = getState().getIn(['timelines', 'home', 'items', 0]); - const lastNotificationId = getState().getIn(['notifications', 'items', 0, 'id']); + const lastNotificationId = getState().getIn(['notifications', 'lastReadId']); if (lastHomeId) { params.home = { @@ -17,7 +17,7 @@ export const submitMarkers = () => (dispatch, getState) => { }; } - if (lastNotificationId) { + if (lastNotificationId && lastNotificationId !== '0') { params.notifications = { last_read_id: lastNotificationId, };