Refetch some data on an interval (#2114)

* Match refetch intervals to stale time

* Lower refetch interval for own-profile
This commit is contained in:
Eric Bailey 2023-12-06 14:31:54 -06:00 committed by GitHub
parent 47771b9066
commit a924df4dcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 4 deletions

View file

@ -15,7 +15,8 @@ export type InviteCodesQueryResponse = Exclude<
>
export function useInviteCodesQuery() {
return useQuery({
staleTime: STALE.HOURS.ONE,
staleTime: STALE.MINUTES.FIVE,
refetchInterval: STALE.MINUTES.FIVE,
queryKey: ['inviteCodes'],
queryFn: async () => {
const res = await getAgent()