Skip to content

Commit

Permalink
Merge pull request #8928 from LedgerHQ/bugfix/tezos-earn
Browse files Browse the repository at this point in the history
fix: tezos earn bakers
  • Loading branch information
qperrot authored Jan 16, 2025
2 parents 5ab951d + 7315d69 commit c0bff4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-terms-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

fix bakers error on tezos earn
6 changes: 3 additions & 3 deletions libs/ledger-live-common/src/families/tezos/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Baker[]>(() =>
const [whitelistedBakers, setWhitelistedBakers] = useState<Baker[]>(() =>
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 {
Expand Down

0 comments on commit c0bff4d

Please sign in to comment.