diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-12-24 10:00:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-24 10:00:29 -0800 |
commit | fe0a35cbea7ff8430f9538d6a641e41ab74ed0a0 (patch) | |
tree | 1cefeb7e1437c1e0611862d888bb10d90425e6d2 /src/state/queries/feed.ts | |
parent | 64bad57eb39269c025c80748966f9ac219daf8ce (diff) | |
download | voidsky-fe0a35cbea7ff8430f9538d6a641e41ab74ed0a0.tar.zst |
Diffstat (limited to 'src/state/queries/feed.ts')
-rw-r--r-- | src/state/queries/feed.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index c87e95f03..7a55b4e18 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -218,11 +218,13 @@ const FOLLOWING_FEED_STUB: FeedSourceInfo = { export function usePinnedFeedsInfos(): { feeds: FeedSourceInfo[] hasPinnedCustom: boolean + isLoading: boolean } { const queryClient = useQueryClient() const [tabs, setTabs] = React.useState<FeedSourceInfo[]>([ FOLLOWING_FEED_STUB, ]) + const [isLoading, setLoading] = React.useState(true) const {data: preferences} = usePreferencesQuery() const hasPinnedCustom = React.useMemo<boolean>(() => { @@ -284,10 +286,11 @@ export function usePinnedFeedsInfos(): { ) as FeedSourceInfo[] setTabs([FOLLOWING_FEED_STUB].concat(views)) + setLoading(false) } fetchFeedInfo() }, [queryClient, setTabs, preferences?.feeds?.pinned]) - return {feeds: tabs, hasPinnedCustom} + return {feeds: tabs, hasPinnedCustom, isLoading} } |