From 518f181c4f02a8ca3340be538d13cf07eb82e1c3 Mon Sep 17 00:00:00 2001 From: Gordon Pedersen Date: Thu, 20 Jun 2024 15:48:51 +1000 Subject: [PATCH] Edit pic fixes --- Components/EditPicDialog.razor | 8 ++++++-- Components/PicCard.razor | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Components/EditPicDialog.razor b/Components/EditPicDialog.razor index 84d4fdf..a8b6f30 100644 --- a/Components/EditPicDialog.razor +++ b/Components/EditPicDialog.razor @@ -4,7 +4,9 @@
- +
+ +
@@ -32,8 +34,10 @@ set { _pic = value; Description = _pic?.Description; + InvokeAsync(StateHasChanged); } } + public string? Description { get; set; } private bool loading = false; [Parameter] @@ -47,7 +51,7 @@ loading = true; await InvokeAsync(StateHasChanged); - if(!string.IsNullOrEmpty(Pic.Id)) { + if(!string.IsNullOrEmpty(Pic?.Id)) { await api.PostPicDescription(State.SelectedAddressName, Pic.Id, Description); await State.RefreshPics(); await InvokeAsync(StateHasChanged); diff --git a/Components/PicCard.razor b/Components/PicCard.razor index 5bf628c..c1fb02c 100644 --- a/Components/PicCard.razor +++ b/Components/PicCard.razor @@ -43,7 +43,7 @@ private async Task EditPic(EventArgs e){ Dialog.Pic = Pic; - // await InvokeAsync(StateHasChanged); + await InvokeAsync(StateHasChanged); await JS.InvokeVoidAsync("ui", "#" + Dialog?.id); }