Skip to content

Commit

Permalink
fix(wallet): show insufficient remaining funds warning logic (#3910)
Browse files Browse the repository at this point in the history
* fix(wallet): shouldShowInsufficientRemainingFundsWarning logic

* fix: clean debris

---------

Co-authored-by: Bran <[email protected]>
Co-authored-by: Marc Espin <[email protected]>
  • Loading branch information
3 people authored Nov 11, 2024
1 parent daf2393 commit 6f6971a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions apps/wallet/src/ui/app/staking/stake/StakeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ function StakeForm({ validatorAddress, coinBalance, coinType, epoch }: StakeFrom

const hasEnoughRemaingBalance =
maxTokenBalance > parseAmount(values.amount, decimals) + BigInt(2) * gasBudget;
const shouldShowInsufficientRemainingFundsWarning =
maxTokenFormatted >= values.amount && !hasEnoughRemaingBalance;

return (
<Form
Expand Down Expand Up @@ -97,7 +95,7 @@ function StakeForm({ validatorAddress, coinBalance, coinType, epoch }: StakeFrom
);
}}
</Field>
{shouldShowInsufficientRemainingFundsWarning ? (
{!hasEnoughRemaingBalance ? (
<InfoBox
type={InfoBoxType.Error}
supportingText="You have selected an amount that will leave you with insufficient funds to pay for gas fees for unstaking or any other transactions."
Expand Down

0 comments on commit 6f6971a

Please sign in to comment.