From de8916fb96a9d7504938416d187c25adc656ed77 Mon Sep 17 00:00:00 2001 From: Dimitrios Maragkos <34100964+Jimmys20@users.noreply.github.com> Date: Fri, 3 May 2024 14:45:43 +0300 Subject: [PATCH] Update BlazoredToasts.razor.cs --- src/Blazored.Toast/BlazoredToasts.razor.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Blazored.Toast/BlazoredToasts.razor.cs b/src/Blazored.Toast/BlazoredToasts.razor.cs index b25003c..a9afa9c 100644 --- a/src/Blazored.Toast/BlazoredToasts.razor.cs +++ b/src/Blazored.Toast/BlazoredToasts.razor.cs @@ -147,9 +147,16 @@ private void ShowCustomToast(Type contentComponent, ToastParameters? parameters, var toastSettings = BuildCustomToastSettings(settings); var toastInstance = new ToastInstance(childContent, toastSettings); - ToastList.Add(toastInstance); + if (ToastList.Count < MaxToastCount) + { + ToastList.Add(toast); - StateHasChanged(); + StateHasChanged(); + } + else + { + ToastWaitingQueue.Enqueue(toast); + } }); }