Skip to content

Commit

Permalink
fix(auth): attempting fix for no query client as recommended by TanSt…
Browse files Browse the repository at this point in the history
  • Loading branch information
clodal committed Sep 26, 2022
1 parent 13c6432 commit 543e707
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-badgers-admire.md
@@ -0,0 +1,5 @@
---
"@gravis-os/auth": patch
---

Attempting fix for no query client as recommended by https://github.com/TanStack/query/issues/3595
4 changes: 2 additions & 2 deletions packages/auth/src/auth/UserProvider.tsx
Expand Up @@ -3,7 +3,7 @@ import { useUser as useAuthUser } from '@supabase/auth-helpers-react'
import { supabaseClient } from '@supabase/auth-helpers-nextjs'
import { useRouter } from 'next/router'
import { CircularProgress } from '@gravis-os/ui'
import { useQuery, useQueryClient } from '@tanstack/react-query'
import { defaultContext, useQuery, useQueryClient } from '@tanstack/react-query'
import { DbUser } from '@gravis-os/types'
import UserContext, { UserContextInterface } from './UserContext'

Expand Down Expand Up @@ -36,7 +36,7 @@ const UserProvider: React.FC<UserProviderProps> = (props) => {
...rest
} = props

const queryClient = useQueryClient()
const queryClient = useQueryClient({ context: defaultContext })
const onUseAuthUser = useAuthUser()
const { user: authUser, ...useAuthUserRest } = onUseAuthUser
const { isLoading: authUserLoading } = useAuthUserRest
Expand Down

0 comments on commit 543e707

Please sign in to comment.