Skip to content

Commit 8a59cf0

Browse files
authored
Merge pull request #1230 from kleros/fix(web)/juror-score-data
fix(web): juror-score-data
2 parents 464fd49 + 48092dd commit 8a59cf0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

web/src/pages/Dashboard/JurorInfo/Coherency.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ const levelTitles = [
2929
const Coherency: React.FC = () => {
3030
const { address } = useAccount();
3131
const { data } = useUserQuery(address?.toLowerCase());
32-
const totalCoherent = parseInt(data?.user?.totalCoherent) ?? 0;
33-
const totalResolvedDisputes = parseInt(data?.user?.totalResolvedDisputes) ?? 1;
32+
const totalCoherent = data?.user ? parseInt(data?.user?.totalCoherent) : 0;
33+
const totalResolvedDisputes = data?.user ? parseInt(data?.user?.totalResolvedDisputes) : 1;
3434
const coherencyScore = calculateCoherencyScore(totalCoherent, totalResolvedDisputes);
3535
const roundedCoherencyScore = Math.round(coherencyScore * 100);
36-
3736
const { level, title } =
3837
levelTitles.find(({ scoreRange }) => {
3938
return roundedCoherencyScore >= scoreRange[0] && roundedCoherencyScore < scoreRange[1];

0 commit comments

Comments
 (0)