Skip to content

Commit

Permalink
Merge pull request #989 from kleros/fix(web)/correctly-pull-policy
Browse files Browse the repository at this point in the history
Fix(web): correctly get policy URI
  • Loading branch information
alcercu authored Jun 28, 2023
2 parents 2d9739b + ae43343 commit c584078
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/hooks/queries/useCourtPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { useIPFSQuery } from "../useIPFSQuery";

export const useCourtPolicy = (courtID?: string) => {
const { data: policyURI } = useCourtPolicyURI(courtID);
return useIPFSQuery(policyURI);
return useIPFSQuery(policyURI?.court?.policy ?? "");
};
4 changes: 1 addition & 3 deletions web/src/hooks/useIPFSQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ export const useIPFSQuery = (ipfsPath?: string) => {
() => (ipfsPath !== undefined ? ipfsPath : false),
async () => {
if (ipfsPath) {
return fetch(`https://cloudflare-ipfs.com${ipfsPath}`).then(
async (res) => await res.json()
);
return fetch(`https://cloudflare-ipfs.com${ipfsPath}`).then(async (res) => await res.json());
} else throw Error;
}
);
Expand Down

0 comments on commit c584078

Please sign in to comment.