about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-02-01 17:53:28 +0100
committerThibG <thib@sitedethib.com>2020-02-01 19:53:01 +0100
commit4cd2d13bd226c005317adf9848f4c0316401b2ff (patch)
tree433383903e34bef4dc9c1a449aad73b02df5483d
parente135b293fae2a9f83975ab0ce4b66c65f90a8f56 (diff)
When submitting markers, use last displayed notification, not last received one
-rw-r--r--app/javascript/flavours/glitch/actions/markers.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/actions/markers.js b/app/javascript/flavours/glitch/actions/markers.js
index defcb7127..7ffab404d 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,
     };