]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix unnecessary loadMore calls when the end of a timeline has been reached
authorThibaut Girka <thib@sitedethib.com>
Sun, 23 Dec 2018 10:40:52 +0000 (11:40 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 23 Dec 2018 10:40:52 +0000 (11:40 +0100)
Port 8389b496ba9f8b5fa04a34ccc14c8e4195e03ea3 to glitch flavour

app/javascript/flavours/glitch/components/scrollable_list.js

index bd922462e9540aebd39815416b2f280566fa6d62..21d717b81676cc30c53851c2f8dc5779ae632c4b 100644 (file)
@@ -47,7 +47,7 @@ export default class ScrollableList extends PureComponent {
       const { scrollTop, scrollHeight, clientHeight } = this.node;
       const offset = scrollHeight - scrollTop - clientHeight;
 
-      if (400 > offset && this.props.onLoadMore && !this.props.isLoading) {
+      if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {
         this.props.onLoadMore();
       }