Skip to content

Commit 7b8f131

Browse files
authored
[Fix] Toast Stack hide (#1111)
* Update Toasts.razor.cs
1 parent 2d6080d commit 7b8f131

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

blazorbootstrap/Components/Toasts/Toasts.razor.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ private async Task OnToastShownAsync(ToastEventArgs args)
6969
foreach (var message in deleteMessages)
7070
{
7171
if (message is not null)
72+
{
7273
Messages.Remove(message);
73-
74-
if (string.IsNullOrWhiteSpace(message!.ElementId))
75-
await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.toasts.hide", message.ElementId);
74+
if (!string.IsNullOrWhiteSpace(message.ElementId))
75+
await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.toasts.hide", message.ElementId);
76+
}
7677
}
7778
}
7879
}

0 commit comments

Comments
 (0)