Skip to content

Commit

Permalink
Add. fix stats bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jee-eun-k committed Mar 28, 2024
1 parent 5bc45d3 commit f47c914
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions src/pages/statistics/ChartContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,7 @@ const ChartContainer = () => {
}
setCategorySum(
() =>
(subCategoryData
? categoryDetailData
: statisticsResult
(subCategoryData ?? statisticsResult
)?.reduce(
(accu: number, curr: StatisticsDetail) =>
accu + curr.timeSum,
Expand All @@ -483,23 +481,6 @@ const ChartContainer = () => {
>
{data.categoryName}
</Typography>
<Box
sx={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
}}
>
sx={{
fontSize: '16px',
lineHeight: '18.75px',
fontWeight: 700,
m: 0,
p: 0,
}}
>
{data.categoryName}
</Typography>
<Box
sx={{
display: 'flex',
Expand Down Expand Up @@ -541,17 +522,6 @@ const ChartContainer = () => {
statisticsResult = statisticsResult.length ? statisticsResult : [];
}, []);

useEffect(() => {
const timeSum = statisticsResult.length
? statisticsResult.reduce(
(accumulator, currentValue) => accumulator + currentValue.timeSum,
0,
)
: 0;
setTotalSum(() => timeSum);
// setCategorySum(() => 0);
}, [totalSumTitle]);

useEffect(() => {
const timeSum = statisticsResult.length
? statisticsResult.reduce(
Expand Down

0 comments on commit f47c914

Please sign in to comment.