From 47e9fb92e35cef89e98f9ce08ee3c749562c800d Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Thu, 30 Oct 2025 12:46:39 +0530 Subject: [PATCH] Update compact-filter.component.ts --- .../dashboardnew/common-filter/compact-filter.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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