@inject IJSRuntime JS @inject State State @inject ApiService api
@code { private MarkdownEditor? Editor; public string? Bio { get; set; } [Parameter] public string? Address { get; set; } private bool loading = true; [Parameter] public string? id { get; set; } protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); Bio = await api.StatuslogBio(Address ?? State.SelectedAddressName!); await InvokeAsync(StateHasChanged); await Editor!.SetValueAsync(Bio); loading = false; await InvokeAsync(StateHasChanged); } public async Task PostBio() { loading = true; await InvokeAsync(StateHasChanged); // Post the bio await api.PostStatuslogBio(Address!, Bio ?? string.Empty); State.CachedAddressBio = Utilities.MdToHtmlMarkup(Bio ?? string.Empty); await JS.InvokeVoidAsync("ui", "#" + id); // reset input await OnInitializedAsync(); loading = false; await InvokeAsync(StateHasChanged); State.SendRefresh(); } }