Skip to content

Commit

Permalink
Merge pull request #1230 from kleros/fix(web)/juror-score-data
Browse files Browse the repository at this point in the history
fix(web): juror-score-data
  • Loading branch information
alcercu authored Sep 18, 2023
2 parents 464fd49 + 48092dd commit 8a59cf0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions web/src/pages/Dashboard/JurorInfo/Coherency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 8a59cf0

Please sign in to comment.