Queue hiding when switching pages

This commit is contained in:
Mark McDowall 2025-10-25 17:18:42 -07:00
parent 064cbdbfb1
commit 8c9be06ead
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View file

@ -63,7 +63,6 @@ function Queue() {
totalRecords,
error,
isFetching,
isFetched,
isLoading,
page,
goToPage,
@ -108,8 +107,10 @@ function Queue() {
const isRefreshing =
isLoading || isEpisodesFetching || isRefreshMonitoredDownloadsExecuting;
// Use isLoading over isFetched to avoid losing the table UI when switching pages
const isAllPopulated =
isFetched &&
!isLoading &&
(isEpisodesPopulated ||
!records.length ||
records.every((e) => !e.episodeIds?.length));

View file

@ -1,4 +1,4 @@
import { useQuery } from '@tanstack/react-query';
import { keepPreviousData, useQuery } from '@tanstack/react-query';
import { useMemo } from 'react';
import { PropertyFilter } from 'App/State/AppState';
import { SortDirection } from 'Helpers/Props/sortDirections';
@ -89,6 +89,7 @@ const usePagedApiQuery = <T>(options: PagedQueryOptions<T>) => {
),
};
},
placeholderData: keepPreviousData,
});
return {