use I80F48 greater than

This commit is contained in:
Tyler Shipe 2021-07-05 13:18:54 -04:00
parent e5c2de9b2e
commit 974b41f2bf
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import { InformationCircleIcon } from '@heroicons/react/outline'
import Tooltip from './Tooltip'
import { sleep } from '../utils'
import { Market } from '@project-serum/serum'
import { ZERO_I80F48 } from '@blockworks-foundation/mango-client'
const BalancesTable = () => {
const balances = useBalances()
@ -50,7 +51,8 @@ const BalancesTable = () => {
{balances.length > 0 &&
(balances.find(({ unsettled }) => unsettled > 0) ||
balances.find(
({ borrows, marginDeposits }) => borrows > 0 && marginDeposits > 0
({ borrows, marginDeposits }) =>
borrows.gt(ZERO_I80F48) && marginDeposits.gt(ZERO_I80F48)
)) ? (
<div
className={`flex items-center justify-between px-4 py-2 mb-2 rounded-md bg-th-bkg-1`}

View File

@ -10,7 +10,6 @@ import { tokenPrecision } from '../../utils/index'
import BorrowModal from '../BorrowModal'
import Button from '../Button'
import DepositModal from '../DepositModal'
import { QUOTE_INDEX } from '@blockworks-foundation/mango-client/lib/src/MangoGroup'
export default function AccountBorrows() {
const balances = useBalances()