We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b8d2b22 + 53429a1 commit 2a29870Copy full SHA for 2a29870
app/[locale]/[state]/analytics/components/analytics-layout.tsx
@@ -272,12 +272,15 @@ export function AnalyticsMainLayout() {
272
}
273
274
React.useEffect(() => {
275
- if (revenueCode !== '') {
+ if (revenueCode !== '' && revenueCode !== null) {
276
const filteredTableData = tableData.data?.tableData.filter(
277
(item: { [x: string]: string }) =>
278
item['revenue-circle-code'] === revenueCode
279
);
280
setFilteredTableData(filteredTableData);
281
+ } else {
282
+ // Reset to show all district data when revenue circle is deselected
283
+ setFilteredTableData(tableData.data?.tableData);
284
285
}, [revenueCode, tableData.data?.tableData]);
286
0 commit comments