mars-v2-frontend/src/hooks/accounts/useCurrentAccount.tsx
Bob van der Helm 74c9a41a8b
fixed refetchgin of account data (#747)
Co-authored-by: Linkie Link <linkielink.dev@gmail.com>
2024-01-24 17:06:12 +01:00

12 lines
342 B
TypeScript

import { useMemo } from 'react'
import useAccount from 'hooks/accounts/useAccount'
import useAccountId from 'hooks/useAccountId'
export default function useCurrentAccount(): Account | undefined {
const accountId = useAccountId()
const { data: account } = useAccount(accountId || undefined)
return useMemo(() => account, [account])
}