From eb92b40dc77d7569501bd9639180d54f96a1b04d Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Tue, 12 Apr 2022 08:53:03 -0700 Subject: [PATCH] fix: Revert Test if active before reducing number of active toasts #922 (#926) This reverts commit 1d96d321b6f90fb261cb92e56ab39ec612d4aa3d. Fixes #928 --- src/lib/toastr/toastr.service.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/toastr/toastr.service.ts b/src/lib/toastr/toastr.service.ts index 3ce0dacc..d936dfdc 100644 --- a/src/lib/toastr/toastr.service.ts +++ b/src/lib/toastr/toastr.service.ts @@ -113,9 +113,7 @@ export class ToastrService { } found.activeToast.toastRef.close(); this.toasts.splice(found.index, 1); - if(this.toasts[this.currentlyActive]) { - this.currentlyActive = this.currentlyActive - 1; - } + this.currentlyActive = this.currentlyActive - 1; if (!this.toastrConfig.maxOpened || !this.toasts.length) { return false; }