diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/common-filter/compact-filter.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/common-filter/compact-filter.component.ts index 8148b5c..da6c536 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/common-filter/compact-filter.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/common-filter/compact-filter.component.ts @@ -223,7 +223,11 @@ export class CompactFilterComponent implements OnInit, OnChanges, OnDestroy { } ngOnDestroy(): void { - // Component cleanup - nothing specific needed for now + // Component cleanup - remove this filter from the filter service + if (this.selectedFilter) { + // Use the proper removeFilter method which handles both filter definition and state + this.filterService.removeFilter(this.selectedFilter.id); + } } // Load available keys from API