Skip to content

Commit

Permalink
validate amount on token change
Browse files Browse the repository at this point in the history
  • Loading branch information
KorbinianK committed Sep 19, 2023
1 parent c59b0e7 commit ed65864
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/bridge-ui-v2/src/components/Bridge/Amount.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
!$destNetwork ||
!$tokenBalance ||
!$selectedToken ||
$enteredAmount === BigInt(0) || // no need to check if the amount is 0
$tokenBalance.symbol !== $selectedToken.symbol
$enteredAmount === BigInt(0) // no need to check if the amount is 0
)
return;
Expand Down
3 changes: 3 additions & 0 deletions packages/bridge-ui-v2/src/components/Bridge/Bridge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@
}
}
}
$: if ($selectedToken) {
amountComponent.validateAmount();
}
</script>

<Card class="w-full md:w-[524px]" title={$t('bridge.title.default')} text={$t('bridge.description')}>
Expand Down

0 comments on commit ed65864

Please sign in to comment.