From 22dedb676be608d226e098bfdc11c48c8715fdfa Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 23 Dec 2018 11:40:52 +0100 Subject: [Glitch] Fix unnecessary loadMore calls when the end of a timeline has been reached Port 8389b496ba9f8b5fa04a34ccc14c8e4195e03ea3 to glitch flavour --- app/javascript/flavours/glitch/components/scrollable_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/scrollable_list.js b/app/javascript/flavours/glitch/components/scrollable_list.js index bd922462e..21d717b81 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.js +++ b/app/javascript/flavours/glitch/components/scrollable_list.js @@ -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(); } -- cgit