Skip to content

Commit

Permalink
Also clear amount-related errors if selected asset changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Sep 25, 2024
1 parent cd5c99f commit 57c0b19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/scenes/SwapCreateScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ export const SwapCreateScene = (props: Props) => {
else if (changed === 'amount' && ['InsufficientFundsError', 'SwapAboveLimitError', 'SwapBelowLimitError'].includes(error.name)) {
clearError = true
}
// Selected asset related errors
else if (changed === 'asset' && ['SwapPermissionError', 'SwapCurrencyError'].includes(error.name)) {
// Selected asset related errors (arbitrarily includes all amount-related
// errors as well)
else if (
changed === 'asset' &&
['SwapPermissionError', 'SwapCurrencyError', 'InsufficientFundsError', 'SwapAboveLimitError', 'SwapBelowLimitError'].includes(error.name)
) {
clearError = true
}

Expand Down

0 comments on commit 57c0b19

Please sign in to comment.