Fix directory showing load more button when no more profiles exist (#37465)
This commit is contained in:
1 parent
bc2f8a358f
commit
93f5ed0fce
3 files changed
+15
-7
No files matched your search
@@ -83,6 +83,9 @@ export const Directory: React.FC<{
|
||||
(state) =>
|
||||
state.user_lists.getIn(['directory', 'isLoading'], true) as boolean,
|
||||
);
|
||||
const hasMore = useAppSelector(
|
||||
(state) => !!state.user_lists.getIn(['directory', 'next']),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
void dispatch(fetchDirectory({ order, local }));
|
||||
@@ -182,7 +185,7 @@ export const Directory: React.FC<{
|
||||
|
||||
<LoadMore
|
||||
onClick={handleLoadMore}
|
||||
visible={!initialLoad}
|
||||
visible={!initialLoad && hasMore}
|
||||
loading={isLoading}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user