mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
28 lines
692 B
Plaintext
28 lines
692 B
Plaintext
@using Remotely.Server.Services
|
|
@inject IToastService ToastService
|
|
|
|
<div class="toast-harness">
|
|
@foreach (var toast in ToastService?.Toasts)
|
|
{
|
|
<div @key="toast.Guid" class="toast-message @toast.ClassString" style="animation-delay: @(toast.Expiration.TotalMilliseconds.ToString() + "ms"); @toast.StyleOverrides">
|
|
@toast.Message
|
|
</div>
|
|
}
|
|
</div>
|
|
|
|
@code {
|
|
|
|
protected override Task OnAfterRenderAsync(bool firstRender)
|
|
{
|
|
if (firstRender)
|
|
{
|
|
ToastService.OnToastsChanged += (s, e) =>
|
|
{
|
|
InvokeAsync(StateHasChanged);
|
|
};
|
|
}
|
|
return base.OnInitializedAsync();
|
|
|
|
}
|
|
}
|