From 967bd543bb7988db6b9585d8c7da7ff3ea62f720 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 5 Oct 2023 16:33:54 +0200 Subject: [PATCH] [Glitch] Fix auto-loading-more when not scrolled Port 2b98e2ecd6224ad41d38f5febd31efa7e4de316d to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/scrollable_list.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/components/scrollable_list.jsx b/app/javascript/flavours/glitch/components/scrollable_list.jsx index b4643151f3..2a746c5bd1 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.jsx +++ b/app/javascript/flavours/glitch/components/scrollable_list.jsx @@ -78,7 +78,7 @@ class ScrollableList extends PureComponent { const clientHeight = this.getClientHeight(); const offset = scrollHeight - scrollTop - clientHeight; - if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) { + if (scrollTop > 0 && offset < 400 && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) { this.props.onLoadMore(); }