ScrollableList: don't call onLoadMore() unless it hasMore

revert-5af0e40a
Alex Gleason 2022-04-23 16:43:37 -05:00
rodzic c4f7106b77
commit bcb8d75f71
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -104,6 +104,12 @@ const ScrollableList: React.FC<IScrollableList> = ({
}
};
const handleEndReached = () => {
if (hasMore && onLoadMore) {
onLoadMore();
}
};
/** Render the actual Virtuoso list */
const renderFeed = (): JSX.Element => (
<Virtuoso
@ -111,7 +117,7 @@ const ScrollableList: React.FC<IScrollableList> = ({
className={className}
data={data}
startReached={onScrollToTop}
endReached={onLoadMore}
endReached={handleEndReached}
isScrolling={isScrolling => isScrolling && onScroll && onScroll()}
itemContent={renderItem}
context={{