@inject IJSRuntime JS @inject State State @inject RestService api @inject NavigationManager navigationManager
@code { [Parameter] public string id { get; set; } [Parameter] public bool Active { get; set; } [Parameter] public string Content { get; set; } = string.Empty; private bool loading = false; public async Task PostEphemeral() { loading = true; await InvokeAsync(StateHasChanged); var result = await api.PostEphemeral(Content); if (result != null) { await State.RefreshStatuses(); State.SendRefresh(); await InvokeAsync(StateHasChanged); } this.Active = false; await JS.InvokeVoidAsync("ui", "#" + id); Content = string.Empty; loading = false; } }