Put fetchMangoGroup on a 20s interval so interest rate changes are reflected in Margin Account summary

This commit is contained in:
dd 2021-04-26 15:17:57 -04:00
parent af33279f42
commit 8f07e6b8dd
1 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,8 @@ import useMarketList from './useMarketList'
import { notify } from '../utils/notifications'
import useInterval from './useInterval'
const _SLOW_REFRESH_INTERVAL = 6 * 1000
const SECONDS = 1000
const _SLOW_REFRESH_INTERVAL = 6 * SECONDS
const marketAddressSelector = (s) => s.selectedMarket.address
const mangoGroupMarketsSelector = (s) => s.selectedMangoGroup.markets
@ -29,6 +30,10 @@ const useHydrateStore = () => {
actions.fetchMangoGroup()
}, [actions])
useInterval(() => {
actions.fetchMangoGroup()
}, 20 * SECONDS)
// load selected market
useEffect(() => {
Market.load(