fix performance api call when no account

This commit is contained in:
saml33 2023-02-13 10:40:21 +11:00
parent 20ba84e88a
commit c2656cd9bf
1 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,7 @@ import {
ANIMATION_SETTINGS_KEY, ANIMATION_SETTINGS_KEY,
// IS_ONBOARDED_KEY // IS_ONBOARDED_KEY
} from 'utils/constants' } from 'utils/constants'
// import { useWallet } from '@solana/wallet-adapter-react' import { useWallet } from '@solana/wallet-adapter-react'
import useLocalStorageState from 'hooks/useLocalStorageState' import useLocalStorageState from 'hooks/useLocalStorageState'
// import AccountOnboardingTour from '@components/tours/AccountOnboardingTour' // import AccountOnboardingTour from '@components/tours/AccountOnboardingTour'
import dayjs from 'dayjs' import dayjs from 'dayjs'
@ -42,7 +42,7 @@ import HealthBar from './HealthBar'
const AccountPage = () => { const AccountPage = () => {
const { t } = useTranslation(['common', 'account']) const { t } = useTranslation(['common', 'account'])
// const { connected } = useWallet() const { connected } = useWallet()
const { group } = useMangoGroup() const { group } = useMangoGroup()
const { mangoAccount, mangoAccountAddress } = useMangoAccount() const { mangoAccount, mangoAccountAddress } = useMangoAccount()
const actions = mangoStore.getState().actions const actions = mangoStore.getState().actions
@ -69,8 +69,7 @@ const AccountPage = () => {
) )
useEffect(() => { useEffect(() => {
if (mangoAccountAddress) { if (mangoAccountAddress || (!mangoAccountAddress && connected)) {
console.log('fired')
actions.fetchAccountPerformance(mangoAccountAddress, 31) actions.fetchAccountPerformance(mangoAccountAddress, 31)
actions.fetchAccountInterestTotals(mangoAccountAddress) actions.fetchAccountInterestTotals(mangoAccountAddress)
} }