@@ -44,6 +44,8 @@ export class FeasibilityQuerySearchComponent implements OnInit, OnDestroy, After
44
44
45
45
elasticSearchEnabled = false ;
46
46
47
+ listIetmDetailsSubscription : Subscription ;
48
+
47
49
selectedDetails$ : Observable < SearchTermDetails > ;
48
50
49
51
searchFilters$ : Observable < SearchFilter [ ] > = of ( [ ] ) ;
@@ -93,6 +95,7 @@ export class FeasibilityQuerySearchComponent implements OnInit, OnDestroy, After
93
95
this . subscription ?. unsubscribe ( ) ;
94
96
this . searchSubscription ?. unsubscribe ( ) ;
95
97
this . searchWithFilterSubscription ?. unsubscribe ( ) ;
98
+ this . listIetmDetailsSubscription ?. unsubscribe ( ) ;
96
99
}
97
100
98
101
/** Search Result Handling */
@@ -154,9 +157,14 @@ export class FeasibilityQuerySearchComponent implements OnInit, OnDestroy, After
154
157
155
158
public setClickedRow ( row : InterfaceTableDataRow ) {
156
159
const originalEntry = row . originalEntry as CriteriaListEntry ;
157
- this . searchTermDetailsService
158
- . getDetailsForListItem ( originalEntry . getId ( ) )
159
- . subscribe ( ( ) => this . openSidenav ( ) ) ;
160
+ this . listIetmDetailsSubscription ?. unsubscribe ( ) ;
161
+ if ( this . isOpen ) {
162
+ this . closeSidenav ( ) ;
163
+ } else {
164
+ this . listIetmDetailsSubscription = this . searchTermDetailsService
165
+ . getDetailsForListItem ( originalEntry . getId ( ) )
166
+ . subscribe ( ( ) => this . openSidenav ( ) ) ;
167
+ }
160
168
}
161
169
162
170
public getElasticSearchFilter ( ) : void {
0 commit comments