Skip to content

Commit

Permalink
Fix origin token decimals (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
abtestingalpha authored Dec 8, 2023
1 parent 6dfa592 commit 953b71e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,9 @@ export const Widget = ({
return networkId === originChain?.id
}, [originChain?.id, networkId])

const formattedInputAmount: bigint = useMemo(
() =>
stringToBigInt(
inputAmount ?? '0',
originToken.decimals ?? originToken.decimals[originChain.id]
),
[inputAmount, originToken]
)
const formattedInputAmount: bigint = useMemo(() => {
return stringToBigInt(inputAmount ?? '0', originTokenDecimals)
}, [inputAmount, originToken])

const isInputValid: boolean = useMemo(() => {
if (inputAmount === '') return false
Expand Down

0 comments on commit 953b71e

Please sign in to comment.