Skip to content

Conversation

@Minnowo
Copy link
Contributor

@Minnowo Minnowo commented Jan 2, 2025

One of my dashboard is failing because of the change of year. This fixes it. I also added a divide by 0 check in the % calculation on pie charts since I was thinking that was the problem at first.

TypeError: reduce of empty array with no initial value
./src/dashboard/Entry/DashboardTable.tsx/DashboardTable/indexedEntries<
src/dashboard/Entry/DashboardTable.tsx:34

  31 |         }, {}),
  32 |     };
  33 |     if (total) {
> 34 |         result.data['Total'] = Object.values(result.data).reduce((acc, value) => acc + value);
     | ^  35 |     }
  36 |     return result;
  37 | })

Copy link
Member

@jmattheis jmattheis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've fixed the underlying issue where the no data check wasn't correctly implemented for all dashboard chart types.

@jmattheis jmattheis merged commit 05c5807 into traggo:master Jan 2, 2025
1 check passed
@jmattheis
Copy link
Member

Released with v0.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants