Skip to content

Commit

Permalink
Merge pull request #17 from kleros/fix/missing-evidence
Browse files Browse the repository at this point in the history
Fix/missing evidence
  • Loading branch information
alcercu authored Jun 24, 2024
2 parents 800e03a + 32878be commit b542c29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/[lang]/case/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function Page({ params: { lang, id } }: DisputePageProps) {
period={dispute.period}
nbChoices={+dispute.nbChoices > 10 ? undefined : +dispute.nbChoices}
lastPeriodChange={dispute.lastPeriodChangeTs}
metaEvidence={metaEvidence}
metaEvidence={metaEvidence ?? null}
evidenceList={evidence}
justifications={justifications}
nbJurors={
Expand Down
10 changes: 7 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { isAddress } from "ethers";
export const ipfs = (uri: string) =>
`${process.env.NEXT_PUBLIC_IPFS_ENDPOINT}${uri}`;

export const ipfsFetcher = async <T>(ipfsURI: string): Promise<T> => {
const res = await axios.get(ipfs(ipfsURI));
return res.data;
export const ipfsFetcher = async <T>(ipfsURI: string): Promise<T | undefined> => {
try {
const res = await axios.get(ipfs(ipfsURI));
return res.data;
} catch {
return undefined;
}
};

export const explorerLink = (address: string) =>
Expand Down

0 comments on commit b542c29

Please sign in to comment.