Skip to content

Commit f92a775

Browse files
authored
fix: provide initial value when reducing ratings (#233)
1 parent 3939fc8 commit f92a775

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/common/response/visualization/DimensionsOfGlobalIssue.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ const DimensionsOfGlobalIssue = ({
6565
const meanRatings = useMemo(() => {
6666
const accumulatedRatings = ratings
6767
.map(({ data }) => data.ratings)
68-
.reduce(compputeMeanRatings);
68+
.reduce(compputeMeanRatings, {
69+
coordination: 0,
70+
global: 0,
71+
socioTechnic: 0,
72+
});
6973
// TODO: Divide only by actual number of ratings i.e. don't count undefined.
7074
const divider = RATING_SCALE * ratings.length;
7175
return {

0 commit comments

Comments
 (0)