Skip to content

Commit

Permalink
fix(live-13764): show gasPrice as error instead of warning (#7669)
Browse files Browse the repository at this point in the history
* fix: show gasPrice as error not warning

* chore: changeset
  • Loading branch information
liviuciulinaru committed Aug 26, 2024
1 parent cd42a80 commit 6ccd01c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/poor-snails-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

show gasPrice as error not warning
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ export const useSwapTransaction = ({

const { account: toAccount } = toState;

const fromAmountError = useFromAmountStatusMessage(bridgeTransaction, ["amount", "gasLimit"]);
// treat the gasPrice error as a warning for swap.
const fromAmountWarning = useFromAmountStatusMessage(bridgeTransaction, ["gasPrice"]);
const fromAmountError = useFromAmountStatusMessage(bridgeTransaction, [
"gasPrice",
"amount",
"gasLimit",
]);

const { isSwapReversable, reverseSwap } = useReverseAccounts({
accounts,
Expand Down Expand Up @@ -216,7 +218,6 @@ export const useSwapTransaction = ({
setFromAmount,
toggleMax,
fromAmountError: maxAmountLowerThanBallanceError || fromAmountError,
fromAmountWarning,
setToAccount,
setToCurrency,
setFromAccount,
Expand Down

0 comments on commit 6ccd01c

Please sign in to comment.