Skip to content

Commit

Permalink
feat(lookup): fazendo lookup cancelar requisiçoes ao fechar modal
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanPonick committed Jan 23, 2024
1 parent bf3ede6 commit 1c0ec40
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ export abstract class PoLookupModalBaseComponent implements OnDestroy, OnInit {
}

searchFilteredItems(): void {
if (this.isLoading) {
this.unsubscribeAllSubscriptions();
}
this.searchSubscription = this.getFilteredItems(this.searchValue)
.pipe(
catchError(error => {
Expand All @@ -370,6 +373,10 @@ export abstract class PoLookupModalBaseComponent implements OnDestroy, OnInit {
}

showMoreEvent() {
if (this.isLoading) {
this.unsubscribeAllSubscriptions();
}

this.page++;
this.isLoading = true;

Expand Down

0 comments on commit 1c0ec40

Please sign in to comment.