reload account performance data for wallet change with no mango account
This commit is contained in:
parent
4e856695ff
commit
260b18fb95
|
@ -32,7 +32,7 @@ import {
|
|||
ANIMATION_SETTINGS_KEY,
|
||||
// IS_ONBOARDED_KEY
|
||||
} from 'utils/constants'
|
||||
// import { useWallet } from '@solana/wallet-adapter-react'
|
||||
import { useWallet } from '@solana/wallet-adapter-react'
|
||||
import useLocalStorageState from 'hooks/useLocalStorageState'
|
||||
// import AccountOnboardingTour from '@components/tours/AccountOnboardingTour'
|
||||
import dayjs from 'dayjs'
|
||||
|
@ -44,7 +44,7 @@ import PnlHistoryModal from '@components/modals/PnlHistoryModal'
|
|||
|
||||
const AccountPage = () => {
|
||||
const { t } = useTranslation(['common', 'account'])
|
||||
// const { connected } = useWallet()
|
||||
const { connected } = useWallet()
|
||||
const { group } = useMangoGroup()
|
||||
const { mangoAccount, mangoAccountAddress } = useMangoAccount()
|
||||
const actions = mangoStore.getState().actions
|
||||
|
@ -74,7 +74,7 @@ const AccountPage = () => {
|
|||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (mangoAccountAddress) {
|
||||
if (mangoAccountAddress || (connected && !mangoAccountAddress)) {
|
||||
const set = mangoStore.getState().set
|
||||
set((s) => {
|
||||
s.mangoAccount.performance.initialLoad = false
|
||||
|
@ -83,7 +83,7 @@ const AccountPage = () => {
|
|||
actions.fetchAccountPerformance(mangoAccountAddress, 1)
|
||||
actions.fetchAccountInterestTotals(mangoAccountAddress)
|
||||
}
|
||||
}, [actions, mangoAccountAddress])
|
||||
}, [actions, connected, mangoAccountAddress])
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
|
Loading…
Reference in New Issue