diff --git a/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx b/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx index 79d7a28ff..6ab19f3eb 100644 --- a/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx +++ b/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx @@ -32,9 +32,9 @@ type LibraryFilterMenuProps = { } export function LibraryFilterMenu(props: LibraryFilterMenuProps): JSX.Element { - const { labels, isValidating: labelsLoading } = useGetLabelsQuery() + const { labels, isLoading: labelsLoading } = useGetLabelsQuery() const { savedSearches, isLoading: searchesLoading } = useGetSavedSearchQuery() - const { subscriptions, isValidating: subscriptionsLoading } = + const { subscriptions, isLoading: subscriptionsLoading } = useGetSubscriptionsQuery() return ( diff --git a/packages/web/lib/networking/queries/useGetLabelsQuery.tsx b/packages/web/lib/networking/queries/useGetLabelsQuery.tsx index a4af02c2c..1c8995990 100644 --- a/packages/web/lib/networking/queries/useGetLabelsQuery.tsx +++ b/packages/web/lib/networking/queries/useGetLabelsQuery.tsx @@ -4,6 +4,7 @@ import { Label, labelFragment } from '../fragments/labelFragment' import { publicGqlFetcher } from '../networkHelpers' type LabelsQueryResponse = { + isLoading: boolean isValidating: boolean labels: Label[] revalidate: () => void @@ -41,6 +42,7 @@ export function useGetLabelsQuery(): LabelsQueryResponse { const result = data as LabelsResponseData const labels = result.labels?.labels as Label[] return { + isLoading: !error && !data, isValidating, labels, revalidate: () => { @@ -52,6 +54,7 @@ export function useGetLabelsQuery(): LabelsQueryResponse { console.log('error', error) } return { + isLoading: !error && !data, isValidating: false, labels: [], // eslint-disable-next-line @typescript-eslint/no-empty-function diff --git a/packages/web/lib/networking/queries/useGetSubscriptionsQuery.tsx b/packages/web/lib/networking/queries/useGetSubscriptionsQuery.tsx index 89bfccf99..4e5b26910 100644 --- a/packages/web/lib/networking/queries/useGetSubscriptionsQuery.tsx +++ b/packages/web/lib/networking/queries/useGetSubscriptionsQuery.tsx @@ -25,6 +25,7 @@ export type Subscription = { } type SubscriptionsQueryResponse = { + isLoading: boolean isValidating: boolean subscriptions: Subscription[] revalidate: () => void @@ -84,6 +85,7 @@ export function useGetSubscriptionsQuery( const result = data as SubscriptionsResponseData const subscriptions = result.subscriptions.subscriptions as Subscription[] return { + isLoading: !error && !data, isValidating, subscriptions, revalidate: () => { @@ -95,6 +97,7 @@ export function useGetSubscriptionsQuery( console.log('error', error) } return { + isLoading: !error && !data, isValidating: true, subscriptions: [], // eslint-disable-next-line @typescript-eslint/no-empty-function