Skip to content

Commit a8e8699

Browse files
authored
Merge pull request #1625 from kleros/fix(web)/prevent-app-crash-while-searching-cases
fix(web): prevent app crash while searching cases
2 parents fdbefcd + 034a818 commit a8e8699

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

web/src/utils/uri.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ import { Dispute_Filter } from "src/graphql/graphql";
55
export const encodeURIFilter = (filter: Dispute_Filter): string => {
66
if (Object.keys(filter).length === 0) {
77
return "all";
8-
} else {
9-
return encodeURI(JSON.stringify(filter));
108
}
9+
return encodeURIComponent(JSON.stringify(filter));
1110
};
1211

1312
export const decodeURIFilter = (filter: string): Dispute_Filter => {
1413
if (filter === "all") {
1514
return {};
16-
} else {
17-
return JSON.parse(decodeURI(filter));
1815
}
16+
return JSON.parse(decodeURI(filter));
1917
};
2018

2119
export const useRootPath = () => {

0 commit comments

Comments
 (0)