From d1ec73a28968a5fa290c37f49512c20117da12d8 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 6 May 2025 23:07:48 +0300 Subject: hide footer when lists list is empty (#8337) --- src/view/com/feeds/ProfileFeedgens.tsx | 10 +++++++++- src/view/com/lists/ProfileLists.tsx | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/view/com/feeds/ProfileFeedgens.tsx b/src/view/com/feeds/ProfileFeedgens.tsx index 76b57d0ee..5ba17e426 100644 --- a/src/view/com/feeds/ProfileFeedgens.tsx +++ b/src/view/com/feeds/ProfileFeedgens.tsx @@ -182,6 +182,7 @@ export const ProfileFeedgens = React.forwardRef< }, [enabled, scrollElRef, setScrollViewTag]) const ProfileFeedgensFooter = React.useCallback(() => { + if (isEmpty) return null return ( ) - }, [hasNextPage, error, isFetchingNextPage, headerOffset, fetchNextPage]) + }, [ + hasNextPage, + error, + isFetchingNextPage, + headerOffset, + fetchNextPage, + isEmpty, + ]) return ( diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx index e264bd6c6..8fea51081 100644 --- a/src/view/com/lists/ProfileLists.tsx +++ b/src/view/com/lists/ProfileLists.tsx @@ -178,6 +178,7 @@ export const ProfileLists = React.forwardRef( }, [enabled, scrollElRef, setScrollViewTag]) const ProfileListsFooter = React.useCallback(() => { + if (isEmpty) return null return ( ( height={180 + headerOffset} /> ) - }, [hasNextPage, error, isFetchingNextPage, headerOffset, fetchNextPage]) + }, [ + hasNextPage, + error, + isFetchingNextPage, + headerOffset, + fetchNextPage, + isEmpty, + ]) return ( -- cgit 1.4.1