From 7315d6978b70f5a0e86d707217a253ae7602c8a4 Mon Sep 17 00:00:00 2001 From: qperrot Date: Thu, 16 Jan 2025 16:53:10 +0100 Subject: [PATCH] fix: tezos earn bakers --- .changeset/sharp-terms-ring.md | 5 +++++ libs/ledger-live-common/src/families/tezos/react.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/sharp-terms-ring.md diff --git a/.changeset/sharp-terms-ring.md b/.changeset/sharp-terms-ring.md new file mode 100644 index 000000000000..05b0bd3a29cf --- /dev/null +++ b/.changeset/sharp-terms-ring.md @@ -0,0 +1,5 @@ +--- +"@ledgerhq/live-common": patch +--- + +fix bakers error on tezos earn diff --git a/libs/ledger-live-common/src/families/tezos/react.ts b/libs/ledger-live-common/src/families/tezos/react.ts index 9e118edac3a1..4b76598d8056 100644 --- a/libs/ledger-live-common/src/families/tezos/react.ts +++ b/libs/ledger-live-common/src/families/tezos/react.ts @@ -4,14 +4,14 @@ import { Baker, Delegation } from "@ledgerhq/coin-tezos/types/index"; import { bakers } from "@ledgerhq/coin-tezos/network/index"; export function useBakers(whitelistAddresses: string[]): Baker[] { - const [bakers, setBakers] = useState(() => + const [whitelistedBakers, setWhitelistedBakers] = useState(() => bakers.listBakersWithDefault(whitelistAddresses), ); useEffect(() => { - bakers.listBakers(whitelistAddresses).then(setBakers); + bakers.listBakers(whitelistAddresses).then(setWhitelistedBakers); }, [bakers, whitelistAddresses]); - return bakers; + return whitelistedBakers; } export function useDelegation(account: AccountLike): Delegation | null | undefined {