Skip to content

Commit

Permalink
Fixed subject complete to avoid calling a reset event when complete
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Oct 22, 2024
1 parent 11aaaa6 commit 338d3bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 5 additions & 1 deletion lib/core/src/lib/search-text/search-text-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -302,6 +305,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {

ngOnDestroy() {
if (this.toggleSearch) {
this.toggleSubscription.unsubscribe();
this.toggleSearch.complete();
this.toggleSearch = null;
}
Expand Down

0 comments on commit 338d3bb

Please sign in to comment.