Edit pic fixes

This commit is contained in:
Gordon Pedersen 2024-06-20 15:48:51 +10:00
parent e4212c9436
commit 518f181c4f
2 changed files with 7 additions and 3 deletions

View file

@ -4,7 +4,9 @@
<div class="overlay" data-ui="#@id"></div> <div class="overlay" data-ui="#@id"></div>
<dialog id="@id"> <dialog id="@id">
<img src="@Pic?.Url" /> <div class="padding center-align">
<img src="@Pic?.Url" class="small-height square" />
</div>
<div class="row"> <div class="row">
<div class="field textarea label border max"> <div class="field textarea label border max">
<InputTextArea @bind-Value="Description"></InputTextArea> <InputTextArea @bind-Value="Description"></InputTextArea>
@ -32,8 +34,10 @@
set { set {
_pic = value; _pic = value;
Description = _pic?.Description; Description = _pic?.Description;
InvokeAsync(StateHasChanged);
} }
} }
public string? Description { get; set; } public string? Description { get; set; }
private bool loading = false; private bool loading = false;
[Parameter] [Parameter]
@ -47,7 +51,7 @@
loading = true; loading = true;
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
if(!string.IsNullOrEmpty(Pic.Id)) { if(!string.IsNullOrEmpty(Pic?.Id)) {
await api.PostPicDescription(State.SelectedAddressName, Pic.Id, Description); await api.PostPicDescription(State.SelectedAddressName, Pic.Id, Description);
await State.RefreshPics(); await State.RefreshPics();
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);

View file

@ -43,7 +43,7 @@
private async Task EditPic(EventArgs e){ private async Task EditPic(EventArgs e){
Dialog.Pic = Pic; Dialog.Pic = Pic;
// await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
await JS.InvokeVoidAsync("ui", "#" + Dialog?.id); await JS.InvokeVoidAsync("ui", "#" + Dialog?.id);
} }