Skip to content

Commit ed60559

Browse files
committed
fix(web): juror-score-data
1 parent 88cb3ca commit ed60559

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)