]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix home TL marker code mishandling gaps
authorThibG <thib@sitedethib.com>
Wed, 16 Sep 2020 18:17:40 +0000 (20:17 +0200)
committerThibaut Girka <thib@sitedethib.com>
Mon, 28 Sep 2020 13:00:19 +0000 (15:00 +0200)
Port eaea2311aaaf030e4a2f5d03be6131d0716fdaf7 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/actions/markers.js

index 6b49ebf8877851e5b763abbc0c767091fb9b14a1..80bcada6edaa45a10be4660d682f48c64c794508 100644 (file)
@@ -60,7 +60,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', 'lastReadId']);
 
   if (lastHomeId && compareId(lastHomeId, state.getIn(['markers', 'home'])) > 0) {