Skip to content

Commit

Permalink
fix: check account balance or spedable is zero in front
Browse files Browse the repository at this point in the history
  • Loading branch information
qperrot committed Jan 29, 2025
1 parent 8fe3614 commit 62c98de
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { SolanaAccount } from "@ledgerhq/live-common/families/solana/types";
import { NavigatorName, ScreenName } from "~/const";
import type { ActionButtonEvent, NavigationParamsType } from "~/components/FabActions";
import { getStakeLabelLocaleBased } from "~/helpers/getStakeLabelLocaleBased";
import { isAccountEmpty } from "@ledgerhq/live-common/account/index";

const getMainActions = ({
account,
Expand All @@ -18,7 +17,7 @@ const getMainActions = ({
parentAccount: Account;
parentRoute: RouteProp<ParamListBase, ScreenName>;
}): ActionButtonEvent[] => {
const delegationDisabled = isAccountEmpty(account);
const delegationDisabled = account.balance.isZero() || account.spendableBalance.isZero() ? true : false;
const label = getStakeLabelLocaleBased();

const navigationParams: NavigationParamsType = delegationDisabled
Expand Down

0 comments on commit 62c98de

Please sign in to comment.