From b6f8674054025fa62d873593a31e77ab93439cc7 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Mon, 9 Nov 2020 01:35:07 -0600 Subject: [PATCH] Added disableInfiniteScroll prop to ScrollableList component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - disableInfiniteScroll prop to ScrollableList component --- app/javascript/gabsocial/components/scrollable_list.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/gabsocial/components/scrollable_list.js b/app/javascript/gabsocial/components/scrollable_list.js index ac9c1ab4..b2c379b2 100644 --- a/app/javascript/gabsocial/components/scrollable_list.js +++ b/app/javascript/gabsocial/components/scrollable_list.js @@ -98,7 +98,7 @@ class ScrollableList extends React.PureComponent { const { innerHeight } = this.window; const offset = scrollHeight - scrollTop - innerHeight; - if (600 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) { + if (600 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading && !this.props.disableInfiniteScroll) { this.props.onLoadMore(); } @@ -271,6 +271,7 @@ ScrollableList.propTypes = { onScroll: PropTypes.func, placeholderComponent: PropTypes.node, placeholderCount: PropTypes.node, + disableInfiniteScroll: PropTypes.bool, } export default ScrollableList \ No newline at end of file