This commit is contained in:
Tyler Shipe 2021-08-17 16:50:16 -04:00
parent f7aa5b6bed
commit a7fc2c6c4d
1 changed files with 3 additions and 3 deletions

View File

@ -43,6 +43,7 @@ export default function TradeForm() {
useEffect(
() =>
useMangoStore.subscribe(
// @ts-ignore
(orderBook) => (orderBookRef.current = orderBook),
(state) => state.selectedMarket.orderBook
),
@ -202,6 +203,7 @@ export default function TradeForm() {
const mangoAccount = useMangoStore.getState().selectedMangoAccount.current
const mangoGroup = useMangoStore.getState().selectedMangoGroup.current
const { askInfo, bidInfo } = useMangoStore.getState().selectedMarket
const wallet = useMangoStore.getState().wallet.current
if (!wallet || !mangoGroup || !mangoAccount || !market) return
@ -228,7 +230,6 @@ export default function TradeForm() {
orderType
)
} else {
const selectedMarket = useMangoStore.getState().selectedMarket;
txid = await mangoClient.placePerpOrder(
mangoGroup,
mangoAccount,
@ -240,9 +241,8 @@ export default function TradeForm() {
baseSize,
orderType,
0,
(side === 'buy') ? selectedMarket.askInfo : selectedMarket.bidInfo
side === 'buy' ? askInfo : bidInfo
)
}
notify({ title: 'Successfully placed trade', txid })