]> cat aescling's git repositories - mastodon.git/commitdiff
When submitting markers, use last displayed notification, not last received one
authorThibaut Girka <thib@sitedethib.com>
Sat, 1 Feb 2020 16:53:28 +0000 (17:53 +0100)
committerThibG <thib@sitedethib.com>
Sat, 1 Feb 2020 18:53:01 +0000 (19:53 +0100)
app/javascript/flavours/glitch/actions/markers.js

index defcb71274c7a0b5030911145b1ff49d6c806d22..7ffab404d7b8ecb753b68afd7a341082c9b77c36 100644 (file)
@@ -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,
     };