Skip to content

Commit

Permalink
fix: remove useless useManifest
Browse files Browse the repository at this point in the history
  • Loading branch information
RamyEB committed May 2, 2024
1 parent d8af953 commit e9d5fb6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { TouchableOpacity } from "react-native";
import { useTranslation } from "react-i18next";

import { Flex, Icon, Text, Tag } from "@ledgerhq/native-ui";
import { useManifest } from "@ledgerhq/live-common/platform/hooks/useManifest";
import { LiveAppManifest } from "@ledgerhq/live-common/platform/types";
import { useLocalLiveAppManifest } from "@ledgerhq/live-common/wallet-api/LocalLiveAppProvider/index";
import { useRemoteLiveAppManifest } from "@ledgerhq/live-common/platform/providers/RemoteLiveAppProvider/index";

import { EvmStakingDrawerProviderIcon } from "./EvmStakingDrawerProviderIcon";
import { ListProvider } from "./types";
Expand Down Expand Up @@ -32,8 +33,11 @@ export function EvmStakingDrawerProvider({
onProviderPress,
redirectIfOneProvider,
}: Props) {
const localManifest = useLocalLiveAppManifest(provider.liveAppId);
const remoteManifest = useRemoteLiveAppManifest(provider.liveAppId);
const manifest = remoteManifest || localManifest;

const { t, i18n } = useTranslation();
const manifest = useManifest(provider.liveAppId);
const hasTag: boolean =
!!provider?.min && i18n.exists(`stake.ethereum.providers.${provider.id}.tag`);

Expand Down
8 changes: 5 additions & 3 deletions apps/ledger-live-mobile/src/families/tron/Votes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ import IlluRewards from "~/icons/images/Rewards";
import ProgressCircle from "~/components/ProgressCircle";
import AccountDelegationInfo from "~/components/AccountDelegationInfo";
import AccountSectionLabel from "~/components/AccountSectionLabel";
import { useManifest } from "@ledgerhq/live-common/platform/hooks/useManifest";
import { StackNavigationProp } from "@react-navigation/stack";
import { ScreenName } from "../../../const";
import { useLocalLiveAppManifest } from "@ledgerhq/live-common/wallet-api/LocalLiveAppProvider";
import { useRemoteLiveAppManifest } from "@ledgerhq/live-common/platform/providers/RemoteLiveAppProvider";

type Props = {
account: TronAccount;
Expand Down Expand Up @@ -61,8 +62,9 @@ const Delegation = ({ account }: Props) => {
const totalVotesUsed = votes.reduce((sum, { voteCount }) => sum + voteCount, 0);
const hasRewards = BigNumber(unwithdrawnReward).gt(0);
const percentVotesUsed = totalVotesUsed / tronPower;

const manifest = useManifest("stakekit");
const localManifest = useLocalLiveAppManifest("stakekit");
const remoteManifest = useRemoteLiveAppManifest("stakekit");
const manifest = remoteManifest || localManifest;

const navigation = useNavigation<StackNavigationProp<ParamListBase, string, ScreenName>>();

Expand Down
70 changes: 0 additions & 70 deletions libs/ledger-live-common/src/platform/hooks/useManifest.test.ts

This file was deleted.

15 changes: 0 additions & 15 deletions libs/ledger-live-common/src/platform/hooks/useManifest.ts

This file was deleted.

0 comments on commit e9d5fb6

Please sign in to comment.