add stale time to score data
All checks were successful
Deploy SSR / deploy (push) Successful in 1m8s
All checks were successful
Deploy SSR / deploy (push) Successful in 1m8s
This commit is contained in:
parent
f0dfbe78ea
commit
763de454e7
@ -12,13 +12,24 @@ import {
|
||||
} from "../ui/pagination";
|
||||
|
||||
type PaginationItemWrapperProps = {
|
||||
/**
|
||||
* Whether a page is currently loading.
|
||||
*/
|
||||
isLoadingPage: boolean;
|
||||
|
||||
/**
|
||||
* The children to render.
|
||||
*/
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
function PaginationItemWrapper({ isLoadingPage, children }: PaginationItemWrapperProps) {
|
||||
return (
|
||||
<PaginationItem className={clsx(isLoadingPage ? "cursor-not-allowed" : "cursor-pointer")}>
|
||||
<PaginationItem
|
||||
className={clsx(isLoadingPage ? "cursor-not-allowed" : "cursor-pointer")}
|
||||
aria-disabled={isLoadingPage}
|
||||
tabIndex={isLoadingPage ? -1 : undefined}
|
||||
>
|
||||
{children}
|
||||
</PaginationItem>
|
||||
);
|
||||
|
@ -28,6 +28,7 @@ export default function PlayerScores({ player, sort, page }: Props) {
|
||||
const { data, isError, isLoading, refetch } = useQuery({
|
||||
queryKey: ["playerScores", player.id, currentSort, currentPage],
|
||||
queryFn: () => scoresaberFetcher.lookupPlayerScores(player.id, currentSort, currentPage),
|
||||
staleTime: 30 * 1000, // Data will be cached for 30 seconds
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
Reference in New Issue
Block a user