Better now edit submit behaviour
This commit is contained in:
parent
57885b4c5e
commit
34caee585f
2 changed files with 15 additions and 6 deletions
|
@ -25,10 +25,11 @@
|
|||
</nav>
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,7 +198,6 @@ namespace Neighbourhood.omg.lol {
|
|||
public async Task<BasicResponseData?> DeletePic(string address, string id) =>
|
||||
(await Delete<BasicResponseData>($"/address/{address}/pics/{id}"));
|
||||
|
||||
|
||||
public async Task<PatchStatusResponseData?> PatchStatus(string address, string id, string content, string? emoji) =>
|
||||
(await Patch<PatchStatusResponseData, PatchStatus>($"/address/{address}/statuses/", new PatchStatus { Id = id, Content = content, Emoji = emoji }));
|
||||
|
||||
|
|
Loading…
Reference in a new issue