Skip to content

Commit

Permalink
fix(suite): no simulation for invalid amount
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Nov 19, 2024
1 parent c98a08e commit 7daecb0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/suite/src/hooks/wallet/useUnstakeEthForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
import { useStakeCompose } from './form/useStakeCompose';
import { useFormDraft } from './useFormDraft';
import { useFees } from './form/useFees';
import { BigNumber } from '@trezor/utils';

type UnstakeOptions = 'all' | 'rewards' | 'other';

Expand Down Expand Up @@ -118,7 +119,11 @@ export const useUnstakeEthForm = ({
useEffect(() => {
const { cryptoInput } = values;

if (!cryptoInput || Object.keys(formState.errors).length) {
if (
!cryptoInput ||
new BigNumber(cryptoInput).lte(0) ||
Object.keys(formState.errors).length
) {
setApproximatedInstantEthAmount(null);

return;
Expand Down

0 comments on commit 7daecb0

Please sign in to comment.