]> cat aescling's git repositories - mastodon.git/commitdiff
Fix public timeline page not paginating correctly (#10245)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 12 Mar 2019 20:53:56 +0000 (21:53 +0100)
committerGitHub <noreply@github.com>
Tue, 12 Mar 2019 20:53:56 +0000 (21:53 +0100)
app/javascript/mastodon/features/standalone/public_timeline/index.js

index 5a67492ac094cc50dcd50b2b709f047bd217ea13..10129e606f60d588b313bb5cc23284502ec42579 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 => {