mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Fixed subject complete to avoid calling a reset event when complete
This commit is contained in:
parent
11aaaa67d5
commit
338d3bb359
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user