]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix public timeline page not paginating correctly
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 12 Mar 2019 20:53:56 +0000 (21:53 +0100)
committerThibaut Girka <thib@sitedethib.com>
Wed, 13 Mar 2019 14:56:51 +0000 (15:56 +0100)
Port da45b8b4c9bf00495bb967dda38064ac74b85ead to glitch-soc

app/javascript/flavours/glitch/features/standalone/public_timeline/index.js

index 079f62f80cb261804ff8baa900740a75e270c155..5e2b3fc6d767be67c0af6138451b40c350333ea0 100644 (file)
@@ -60,9 +60,13 @@ class PublicTimeline extends React.PureComponent {
     }
   }
 
-  handleLoadMore = maxId => {
-    const { dispatch, local } = this.props;
-    dispatch(local ? expandCommunityTimeline({ maxId }) : expandPublicTimeline({ maxId }));
+  handleLoadMore = () => {
+    const { dispatch, statusIds, local } = this.props;
+    const maxId = statusIds.last();
+
+    if (maxId) {
+      dispatch(local ? expandCommunityTimeline({ maxId }) : expandPublicTimeline({ maxId }));
+    }
   }
 
   setRef = c => {