diff --git a/Components/Pages/EditNow.razor b/Components/Pages/EditNow.razor index 67ef8a3..6cf9b2d 100644 --- a/Components/Pages/EditNow.razor +++ b/Components/Pages/EditNow.razor @@ -25,10 +25,11 @@ @code { - MarkdownEditor Editor; - bool listed; - string markdownValue; - string markdownHtml; + private MarkdownEditor Editor; + private bool listed; + private string markdownValue; + + private bool loading = false; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); @@ -47,6 +48,15 @@ } public async Task Save() { - await api.PostNowPage(State.SelectedAddressName, markdownValue, listed); + loading = true; + await InvokeAsync(StateHasChanged); + var result = await api.PostNowPage(State.SelectedAddressName, markdownValue, listed); + if (result != null) { + await State.RefreshNow(); + await InvokeAsync(StateHasChanged); + Nav.NavigateTo($"/person/{State.SelectedAddressName}#now"); + } + + loading = false; } } diff --git a/RestService.cs b/RestService.cs index 874d6b7..90f63ae 100644 --- a/RestService.cs +++ b/RestService.cs @@ -198,7 +198,6 @@ namespace Neighbourhood.omg.lol { public async Task DeletePic(string address, string id) => (await Delete($"/address/{address}/pics/{id}")); - public async Task PatchStatus(string address, string id, string content, string? emoji) => (await Patch($"/address/{address}/statuses/", new PatchStatus { Id = id, Content = content, Emoji = emoji }));