Skip to content

Commit

Permalink
[LIVE-12730][tron] Remove unused invariant check (#6931)
Browse files Browse the repository at this point in the history
* delete useless invariant check

* Correct typing in component
  • Loading branch information
lvndry committed May 28, 2024
1 parent 89fe72a commit 73901ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-rules-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Remove unused invariant in tron accountActions
20 changes: 9 additions & 11 deletions apps/ledger-live-mobile/src/families/tron/accountActions.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import React from "react";
import { Trans } from "react-i18next";
import type { Account } from "@ledgerhq/types-live";
import type { TronAccount } from "@ledgerhq/live-common/families/tron/types";
import { NavigatorName, ScreenName } from "~/const";
import { ActionButtonEvent, NavigationParamsType } from "~/components/FabActions";
import { isAccountEmpty } from "@ledgerhq/live-common/account/index";
import invariant from "invariant";
import { TRX } from "../../../../../libs/ui/packages/crypto-icons/native";
import { getMainAccount, isAccountEmpty } from "@ledgerhq/live-common/account/index";
import { TRX } from "@ledgerhq/native-ui/assets/cryptoIcons";
import { TokenAccount } from "@ledgerhq/types-live";

const getMainActions = ({
account,
parentAccount,
}: {
account: TronAccount;
parentAccount: Account;
account: TronAccount | TokenAccount;
parentAccount: TronAccount | null | undefined;
}): ActionButtonEvent[] => {
const { tronResources } = account;
invariant(tronResources, "tron resources not parsed");

const navigationParams: NavigationParamsType = isAccountEmpty(account)
const mainAccount = getMainAccount(account, parentAccount);
const navigationParams: NavigationParamsType = isAccountEmpty(mainAccount)
? [
NavigatorName.NoFundsFlow,
{
Expand All @@ -35,11 +32,12 @@ const getMainActions = ({
params: {
platform: "stakekit",
name: "StakeKit",
accountId: account.id,
accountId: mainAccount.id,
yieldId: "tron-trx-native-staking",
},
},
];

return [
{
id: "stake",
Expand Down

0 comments on commit 73901ee

Please sign in to comment.