update funding data on account change

This commit is contained in:
saml33 2023-03-27 14:58:55 +11:00
parent ce1502ce96
commit 5f4dee638b
1 changed files with 11 additions and 7 deletions

View File

@ -126,13 +126,17 @@ const AccountPage = () => {
data: fundingData,
isLoading: loadingFunding,
isFetching: fetchingFunding,
} = useQuery(['funding'], () => fetchFundingTotals(mangoAccountAddress), {
cacheTime: 1000 * 60 * 10,
staleTime: 1000 * 60,
retry: 3,
refetchOnWindowFocus: false,
enabled: !!mangoAccountAddress,
})
} = useQuery(
['funding', mangoAccountAddress],
() => fetchFundingTotals(mangoAccountAddress),
{
cacheTime: 1000 * 60 * 10,
staleTime: 1000 * 60,
retry: 3,
refetchOnWindowFocus: false,
enabled: !!mangoAccountAddress,
}
)
const oneDayPerformanceData: PerformanceDataItem[] | [] = useMemo(() => {
if (!performanceData || !performanceData.length) return []