fetch trade history when switching accounts

This commit is contained in:
Tyler Shipe 2021-06-07 13:00:00 -04:00
parent 448d6e0bc3
commit c44105e4cd
1 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,7 @@ const AccountsModal: FunctionComponent<AccountsModalProps> = ({
const selectedMangoGroup = useMangoStore((s) => s.selectedMangoGroup.current)
const prices = useMangoStore((s) => s.selectedMangoGroup.prices)
const setMangoStore = useMangoStore((s) => s.set)
const actions = useMangoStore((s) => s.actions)
const [, setLastAccountViewed] = useLocalStorageState('lastAccountViewed')
const handleMarginAccountChange = (marginAccount: MarginAccount) => {
@ -40,6 +41,7 @@ const AccountsModal: FunctionComponent<AccountsModalProps> = ({
setMangoStore((state) => {
state.selectedMarginAccount.current = marginAccount
})
actions.fetchTradeHistory()
onClose()
}