diff --git a/src/components/pages/statistics/ActiveMembersComposition.tsx b/src/components/pages/statistics/ActiveMembersComposition.tsx index 9cdd6adf..f1552178 100644 --- a/src/components/pages/statistics/ActiveMembersComposition.tsx +++ b/src/components/pages/statistics/ActiveMembersComposition.tsx @@ -225,7 +225,11 @@ export default function ActiveMembersComposition({ if (existingFilterIndex !== -1) { // If it exists, replace the existing filter's label with the new label - existingFilters[existingFilterIndex].label = label; + if (existingFilters[existingFilterIndex].label !== label) { + existingFilters[existingFilterIndex].label = label; + } else { + existingFilters = []; + } } else { // If it doesn't exist, add the new filter to the array existingFilters.push(newFilter); diff --git a/src/components/pages/statistics/DisengagedMembersComposition.tsx b/src/components/pages/statistics/DisengagedMembersComposition.tsx index bd38ad00..77eaf9db 100644 --- a/src/components/pages/statistics/DisengagedMembersComposition.tsx +++ b/src/components/pages/statistics/DisengagedMembersComposition.tsx @@ -210,7 +210,11 @@ export default function DisengagedMembersComposition({ if (existingFilterIndex !== -1) { // If it exists, replace the existing filter's label with the new label - existingFilters[existingFilterIndex].label = label; + if (existingFilters[existingFilterIndex].label !== label) { + existingFilters[existingFilterIndex].label = label; + } else { + existingFilters = []; + } } else { // If it doesn't exist, add the new filter to the array existingFilters.push(newFilter); diff --git a/src/components/pages/statistics/Onboarding.tsx b/src/components/pages/statistics/Onboarding.tsx index 7f952a16..c31dd9f5 100644 --- a/src/components/pages/statistics/Onboarding.tsx +++ b/src/components/pages/statistics/Onboarding.tsx @@ -187,7 +187,11 @@ export default function Onboarding({ if (existingFilterIndex !== -1) { // If it exists, replace the existing filter's label with the new label - existingFilters[existingFilterIndex].label = label; + if (existingFilters[existingFilterIndex].label !== label) { + existingFilters[existingFilterIndex].label = label; + } else { + existingFilters = []; + } } else { // If it doesn't exist, add the new filter to the array existingFilters.push(newFilter); diff --git a/src/components/pages/statistics/memberBreakdowns/activeMembers/ActiveMemberBreakdown.tsx b/src/components/pages/statistics/memberBreakdowns/activeMembers/ActiveMemberBreakdown.tsx index d4299497..9cee797f 100644 --- a/src/components/pages/statistics/memberBreakdowns/activeMembers/ActiveMemberBreakdown.tsx +++ b/src/components/pages/statistics/memberBreakdowns/activeMembers/ActiveMemberBreakdown.tsx @@ -116,6 +116,10 @@ export default function ActiveMemberBreakdown() { const matchedValue = matchedOption.value; handleActivityOptionSelectionChange([matchedValue]); } + } else { + handleActivityOptionSelectionChange( + options.map((option) => option.value) + ); } } } diff --git a/src/components/pages/statistics/memberBreakdowns/disengagedMembersComposition/DisengagedMembersCompositionBreakdown.tsx b/src/components/pages/statistics/memberBreakdowns/disengagedMembersComposition/DisengagedMembersCompositionBreakdown.tsx index f98f1084..f4622493 100644 --- a/src/components/pages/statistics/memberBreakdowns/disengagedMembersComposition/DisengagedMembersCompositionBreakdown.tsx +++ b/src/components/pages/statistics/memberBreakdowns/disengagedMembersComposition/DisengagedMembersCompositionBreakdown.tsx @@ -46,10 +46,7 @@ const options: IActivityCompositionOptions[] = [ ]; export default function DisengagedMembersCompositionBreakdown() { - const { - getDisengagedMembersCompositionTable, - isDisengagedMembersCompositionBreakdownLoading, - } = useAppStore(); + const { getDisengagedMembersCompositionTable } = useAppStore(); const tableTopRef = useRef(null); @@ -130,6 +127,10 @@ export default function DisengagedMembersCompositionBreakdown() { const matchedValue = matchedOption.value; handleActivityOptionSelectionChange([matchedValue]); } + } else { + handleActivityOptionSelectionChange( + options.map((option) => option.value) + ); } } } diff --git a/src/components/pages/statistics/memberBreakdowns/onboardingMembers/OnboardingMembersBreakdown.tsx b/src/components/pages/statistics/memberBreakdowns/onboardingMembers/OnboardingMembersBreakdown.tsx index cde6c617..82652b62 100644 --- a/src/components/pages/statistics/memberBreakdowns/onboardingMembers/OnboardingMembersBreakdown.tsx +++ b/src/components/pages/statistics/memberBreakdowns/onboardingMembers/OnboardingMembersBreakdown.tsx @@ -34,10 +34,7 @@ const options: IActivityCompositionOptions[] = [ ]; export default function OnboardingMembersBreakdown() { - const { - getOnboardingMemberCompositionTable, - isOnboardingMembersBreakdownLoading, - } = useAppStore(); + const { getOnboardingMemberCompositionTable } = useAppStore(); const tableTopRef = useRef(null); @@ -118,6 +115,10 @@ export default function OnboardingMembersBreakdown() { const matchedValue = matchedOption.value; handleActivityOptionSelectionChange([matchedValue]); } + } else { + handleActivityOptionSelectionChange( + options.map((option) => option.value) + ); } } }