Fixed subject complete to avoid calling a reset event when complete

This commit is contained in:
VitoAlbano 2024-10-22 16:23:49 +01:00
parent 11aaaa67d5
commit 338d3bb359
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
<div (keyup)="onKeyPress($event)" tabindex="-1" role="button" class="adf-notification-history-container">
<button mat-button
[matMenuTriggerFor]="menu"
aria-hidden="false"
[attr.aria-label]="'NOTIFICATIONS.OPEN_HISTORY' | translate"
title="{{ 'NOTIFICATIONS.OPEN_HISTORY' | translate }}"
class="adf-notification-history-menu_button"

View File

@ -166,9 +166,12 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
private toggleSearch = new Subject<any>();
private focusSubscription: Subscription;
private valueChange = new Subject<string>();
private toggleSubscription: Subscription;
toggle$ = this.toggleSearch.asObservable();
constructor(private userPreferencesService: UserPreferencesService) {
this.toggleSearch.pipe(debounceTime(200), takeUntil(this.onDestroy$)).subscribe(() => {
this.toggleSubscription = this.toggle$.pipe(debounceTime(200), takeUntil(this.onDestroy$)).subscribe(() => {
if (this.expandable) {
this.subscriptAnimationState = this.toggleAnimation();
if (this.subscriptAnimationState.value === 'inactive') {
@ -302,6 +305,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
ngOnDestroy() {
if (this.toggleSearch) {
this.toggleSubscription.unsubscribe();
this.toggleSearch.complete();
this.toggleSearch = null;
}