Overfetch trending topics before filtering (#11477)

This commit is contained in:
DS Boyce
2026-08-24 11:39:46 -07:00
committed by GitHub
parent 6009e61ae9
commit 6f46927c28
5 changed files with 14 additions and 169 deletions
@@ -11,6 +11,7 @@ import {
useTrendingSettingsApi,
} from '#/state/preferences/trending'
import {
DEFAULT_FETCH_LIMIT,
DEFAULT_LIMIT,
useGetTrendsQuery,
} from '#/state/queries/trending/useGetTrendsQuery'
@@ -57,7 +58,10 @@ function Inner() {
error,
isLoading,
isRefetching,
} = useGetTrendsQuery({limit: topicCount})
} = useGetTrendsQuery({
fetchLimit: Math.min(topicCount * 2, DEFAULT_FETCH_LIMIT),
limit: topicCount,
})
const noTopics = !isLoading && !error && !trending?.trends?.length
const showLoading = isLoading || isRefetching