mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #4298 from omnivore-app/fix/web-dont-cache-null-viewer
If we get null for viewer do not cache it as theres no stale key
This commit is contained in:
commit
97df715cd0
1 changed files with 3 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ export function useGetViewer() {
|
|||
staleTime: Infinity,
|
||||
queryFn: async () => {
|
||||
const response = (await gqlFetcher(GQL_GET_VIEWER)) as ViewerData
|
||||
if (!response.me) {
|
||||
throw new Error('no user found')
|
||||
}
|
||||
return response.me
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue