Skip to content

Commit

Permalink
fix(thesis): optional chaining to avoid error before data
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Sep 3, 2024
1 parent f361267 commit 787c177
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const Chart = ({ domain, hasComments, hasFooter, id }) => {
allData.comments.sort = intl
.formatMessage({ id: `app.publi.${sort}` })
.toLowerCase();
allData.comments.discipline = categories[0].key;
allData.comments.rate = Math.round(categories[0].percent);
allData.comments.discipline = categories[0]?.key;
allData.comments.rate = Math.round(categories[0]?.percent);
setChartComments(customComments(allData, idWithDomain, intl));
}
}, [allData, categories, dataGraph, dataTitle, id, idWithDomain, intl, sort]);
Expand Down

0 comments on commit 787c177

Please sign in to comment.