Skip to content

Commit

Permalink
hotfix: crash page when creating pool
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Nov 3, 2023
1 parent d9456db commit f218e63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/state/swap/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export function tryParseAmount<T extends Currency>(
const typedValueParsed = parseFraction(value)
.multiply(scaleDecimals ? 10 ** currency.decimals : 1)
.toFixed(0)

if (typedValueParsed === '0') return undefined
const result = CurrencyAmount.fromRawAmount(currency, typedValueParsed)
return result
} catch (error) {
Expand Down

0 comments on commit f218e63

Please sign in to comment.