Skip to content

Commit

Permalink
adjust query options for useSingleProject()
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Dec 12, 2024
1 parent 9f36efe commit 224b9ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/hooks/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ export function useProjectSettings({ projectId }: { projectId: string }) {
export function useSingleProject({ projectId }: { projectId: string }) {
const clientApi = useClientApi()

const { data, error, isRefetching } = useSuspenseQuery(
projectByIdQueryOptions({
const { data, error, isRefetching } = useSuspenseQuery({
...projectByIdQueryOptions({
clientApi,
projectId,
}),
)
// Keep project instances around indefinitely - shouldn't be a memory
// problem because these are only lightweight proxy objects, and project
// references are kept indefinitely on the backend anyway once they are
// accessed
staleTime: Infinity,
gcTime: Infinity,
})

return { data, error, isRefetching }
}
Expand Down

0 comments on commit 224b9ff

Please sign in to comment.