Skip to content

Commit

Permalink
feat(nami): [lw-1200] show tx related error after ui related ones in …
Browse files Browse the repository at this point in the history
…asset input (#1606)
  • Loading branch information
vetalcore authored and mirceahasegan committed Dec 19, 2024
1 parent 5988e92 commit 4fe3f9e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ export const useSelectedCoins = ({
*/
const getError = useCallback(
(inputId: string, assetInput: AssetInfo): string | undefined => {
// If there is an error with the transaction, then display it over any other potential error
if (builtTxError) return builtTxError;

// If the asset has an input value but there is no sufficient balance, then display an insufficient balance error.
if (assetInput?.value && assetInput.value !== '0' && !!insufficientBalanceInputs?.includes(inputId)) {
return COIN_SELECTION_ERRORS.BALANCE_INSUFFICIENT_ERROR;
Expand All @@ -101,6 +98,8 @@ export const useSelectedCoins = ({
if (address && isValidAddress(address) && assetInputList.every((item) => !(item.value && Number(item.value)))) {
return COIN_SELECTION_ERRORS.BUNDLE_AMOUNT_IS_EMPTY;
}
// Display an error with the tx itself
if (builtTxError) return builtTxError;
// eslint-disable-next-line consistent-return
return undefined;
},
Expand Down

0 comments on commit 4fe3f9e

Please sign in to comment.