Skip to content

Commit

Permalink
Bean UI - Fix Typescript error in approval check (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofromguy authored Jun 28, 2023
2 parents bcc0e93 + 720ff61 commit 4d8287e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion projects/ui/src/components/Barn/Actions/Buy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const BuyForm: FC<
/// Approval Checks
const shouldApprove =
values.balanceFrom === BalanceFrom.EXTERNAL ||
values.balanceFrom === BalanceFrom.TOTAL && values.tokens[0].amount?.gt(balances[tokenIn.address].internal);
values.balanceFrom === BalanceFrom.TOTAL && values.tokens[0].amount?.gt(balances[tokenIn.address]?.internal);

return (
<FormWithDrawer autoComplete="off" noValidate siblingRef={formRef}>
Expand Down
2 changes: 1 addition & 1 deletion projects/ui/src/components/Field/Actions/Sow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const SowForm: FC<
/// Approval Checks
const shouldApprove =
values.balanceFrom === BalanceFrom.EXTERNAL ||
values.balanceFrom === BalanceFrom.TOTAL && values.tokens[0].amount?.gt(balances[tokenIn.address].internal);
values.balanceFrom === BalanceFrom.TOTAL && values.tokens[0].amount?.gt(balances[tokenIn.address]?.internal);

const handleSetBalanceFrom = useCallback(
(_balanceFrom: BalanceFrom) => {
Expand Down
2 changes: 1 addition & 1 deletion projects/ui/src/components/Silo/Actions/Deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const DepositForm: FC<
/// Approval Checks
const shouldApprove =
values.balanceFrom === BalanceFrom.EXTERNAL ||
values.balanceFrom === BalanceFrom.TOTAL && values.tokens[0].amount?.gt(balances[tokenIn.address].internal);
values.balanceFrom === BalanceFrom.TOTAL && values.tokens[0].amount?.gt(balances[tokenIn.address]?.internal);

return (
<FormWithDrawer noValidate autoComplete="off" siblingRef={siblingRef}>
Expand Down

0 comments on commit 4d8287e

Please sign in to comment.