Skip to content

Commit

Permalink
fix(wallet-button): send max quantity format
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Jan 7, 2025
1 parent 8520423 commit c941421
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const EditAmountScreen = () => {
(text: string) => {
try {
const [input, quantity] = Quantities.parseFromText(text, amount.info.decimals ?? 0, numberLocale)

setInputValue(input)
setQuantity(BigInt(quantity))
} catch (error) {
Expand All @@ -85,10 +86,9 @@ export const EditAmountScreen = () => {
)

const handleOnMaxBalance = React.useCallback(() => {
const [input, quantity] = Quantities.parseFromText(spendable.toString(), amount.info.decimals ?? 0, numberLocale)
setInputValue(input)
setQuantity(BigInt(quantity))
}, [amount.info.decimals, numberLocale, spendable])
setInputValue(atomicBreakdown(spendable, amount.info.decimals).bn.toFormat())
setQuantity(spendable)
}, [amount.info.decimals, spendable])

const handleOnApply = React.useCallback(() => {
amountChanged({
Expand Down

0 comments on commit c941421

Please sign in to comment.