Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nami): [lw-1200] show tx related error after ui related ones in … #1606

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading