fix(feed): clarify loading states

This commit is contained in:
Tommaso Casaburi
2026-05-24 16:25:02 +07:00
parent 0df81b598e
commit a6a1320381
4 changed files with 62 additions and 4 deletions
+6 -3
View File
@@ -92,8 +92,11 @@ const BoardFooter = ({
const loadingStateString = useFeedStateString(communityAddresses) || (combinedFeedLength === 0 ? t('downloading_board') : t('looking_for_more_posts'));
const isLoadedCommunityState = communityState === 'succeeded' || communityState === 'ready';
const canShowNoThreads = !isSingleCommunityBoard || (isLoadedCommunityState && feedState === 'succeeded');
const isEmptyBoardLoading = isSingleCommunityBoard && combinedFeedLength === 0 && !canShowNoThreads && communityState !== 'failed';
const isFeedSucceeded = feedState === 'succeeded';
const isFeedFailed = feedState === 'failed';
const canShowNoThreads = isSingleCommunityBoard ? isLoadedCommunityState && isFeedSucceeded : isFeedSucceeded && !hasMore;
const isEmptyFeedLoading = combinedFeedLength === 0 && !canShowNoThreads && (isSingleCommunityBoard ? communityState !== 'failed' : !isFeedFailed);
const showFooterLoading = showLoadingEllipsis && (hasMore || isEmptyFeedLoading);
let footerContent;
if (moreThreadsSuggestion && moreThreadsSuggestionPathname) {
@@ -140,7 +143,7 @@ const BoardFooter = ({
) : isInModView && accountCommunityAddressesLength === 0 ? (
<ModEmptyState />
) : (
showLoadingEllipsis && (hasMore || isEmptyBoardLoading) && <LoadingEllipsis string={loadingStateString} />
showFooterLoading && <LoadingEllipsis string={loadingStateString} />
)}
</div>
</div>