@inject IJSRuntime JS @inject State State @inject RestService api @inject NavigationManager navigationManager
Share a fleeting thought

Your anonymous post will be shared for a while, and then it will disappear forever. It can’t be edited, so take care before submitting.

If you need help, don’t suffer in silence. Talk to someone right now.

@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; } }