Skip to content

Commit

Permalink
Merge pull request #192 from hackdays-io/add_issue175
Browse files Browse the repository at this point in the history
fix type error
  • Loading branch information
yu23ki14 authored Dec 1, 2024
2 parents bb72672 + e37ed80 commit 2b03c34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkgs/frontend/hooks/useHats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,13 @@ export const useHats = () => {
try {
const treeId = hatIdToTreeId(BigInt(params.hatId));
// get TreeInfo
const { hats } = await getTreeInfo({
const tree = await getTreeInfo({
chainId: params.chainId,
treeId,
});
const hatterHat = hats?.find((hat: Hat) => hat.levelAtLocalTree === 1);
const hatterHat = tree?.hats?.find(
(hat: Hat) => hat.levelAtLocalTree === 1
);
if (!hatterHat) {
throw new Error("Hatter hat not found");
}
Expand Down

0 comments on commit 2b03c34

Please sign in to comment.