Skip to content

Commit

Permalink
[fix] use placeholder amount in deposit tokens dialog (#1879)
Browse files Browse the repository at this point in the history
  • Loading branch information
asktree authored Oct 16, 2023
1 parent 52be309 commit 8fa5a6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/DepositTokensButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@ export const DepositTokensButton = ({
<Button
onClick={async () => {
if (mintInfo === undefined) throw new Error()
const nativeAmount = new BN(
new BigNumber(amount).shiftedBy(mintInfo.decimals).toString()
)
// max is the placeholder, so deposit the maximum amount if no value is input
const nativeAmount =
amount === ''
? new BN(depositAmount.toString())
: new BN(
new BigNumber(amount)
.shiftedBy(mintInfo.decimals)
.toString()
)
await deposit(nativeAmount)
setOpenModal(false)
}}
Expand Down

1 comment on commit 8fa5a6b

@vercel
Copy link

@vercel vercel bot commented on 8fa5a6b Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.