]> cat aescling's git repositories - mastodon.git/commitdiff
Fix home TL marker code mishandling gaps (#14809)
authorThibG <thib@sitedethib.com>
Wed, 16 Sep 2020 18:17:40 +0000 (20:17 +0200)
committerGitHub <noreply@github.com>
Wed, 16 Sep 2020 18:17:40 +0000 (20:17 +0200)
app/javascript/mastodon/actions/markers.js

index 37d1ddccfeecae8414a202d4a61c43e3d3aadde6..6cb09fe96ce6c83031d69e17fc5a17606beb22f5 100644 (file)
@@ -57,7 +57,7 @@ export const synchronouslySubmitMarkers = () => (dispatch, getState) => {
 const _buildParams = (state) => {
   const params = {};
 
-  const lastHomeId         = state.getIn(['timelines', 'home', 'items', 0]);
+  const lastHomeId         = state.getIn(['timelines', 'home', 'items']).find(item => item !== null);
   const lastNotificationId = state.getIn(['notifications', 'items', 0, 'id']);
 
   if (lastHomeId && compareId(lastHomeId, state.getIn(['markers', 'home'])) > 0) {