From ed605591ee503f2d8e56fb9c088cfc33de15f0dc Mon Sep 17 00:00:00 2001 From: nhestrompia Date: Fri, 15 Sep 2023 15:20:24 +0300 Subject: [PATCH] fix(web): juror-score-data --- web/src/pages/Dashboard/JurorInfo/Coherency.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/pages/Dashboard/JurorInfo/Coherency.tsx b/web/src/pages/Dashboard/JurorInfo/Coherency.tsx index 22b553844..c20a3e8ab 100644 --- a/web/src/pages/Dashboard/JurorInfo/Coherency.tsx +++ b/web/src/pages/Dashboard/JurorInfo/Coherency.tsx @@ -29,11 +29,10 @@ const levelTitles = [ const Coherency: React.FC = () => { const { address } = useAccount(); const { data } = useUserQuery(address?.toLowerCase()); - const totalCoherent = parseInt(data?.user?.totalCoherent) ?? 0; - const totalResolvedDisputes = parseInt(data?.user?.totalResolvedDisputes) ?? 1; + const totalCoherent = data?.user ? parseInt(data?.user?.totalCoherent) : 0; + const totalResolvedDisputes = data?.user ? parseInt(data?.user?.totalResolvedDisputes) : 1; const coherencyScore = calculateCoherencyScore(totalCoherent, totalResolvedDisputes); const roundedCoherencyScore = Math.round(coherencyScore * 100); - const { level, title } = levelTitles.find(({ scoreRange }) => { return roundedCoherencyScore >= scoreRange[0] && roundedCoherencyScore < scoreRange[1];