Skip to content

Commit e1560dd

Browse files
authored
Merge pull request #3988 from IntersectMBO/fix/invalid-ipfs-vote-context-request
Fix: handle ipfs link for vote context validation
2 parents f203b5c + 6c64ca8 commit e1560dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

govtool/frontend/src/hooks/queries/useGetVoteContextTextFromFile.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export const useGetVoteContextTextFromFile = (url: string | undefined,
1010
const { dRepID } = useCardano();
1111
const { voter } = useGetVoterInfo();
1212

13+
if (url && url.startsWith("ipfs://")) {
14+
url = url.replace("ipfs://", "https://ipfs.io/ipfs/");
15+
}
16+
1317
const { data, isLoading } = useQuery(
1418
[QUERY_KEYS.useGetVoteContextFromFile, url],
1519
() => getVoteContextTextFromFile(url, contextHash),

0 commit comments

Comments
 (0)