From ca141e3ebd3232a0f304b183b3a500360856761e Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Tue, 16 Dec 2025 12:24:12 +0100 Subject: [PATCH] Improvement of the ReviewAttachmentsDialog: add delete function and check for existence of the file --- .../Dialogs/ReviewAttachmentsDialog.razor | 33 ++++++++++++++++--- .../Dialogs/ReviewAttachmentsDialog.razor.cs | 8 +++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor index 30c56f95..ba65f820 100644 --- a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor @@ -7,10 +7,35 @@ @foreach (var filePath in this.DocumentPaths) { - - + @if (File.Exists(filePath)) + { + + + + + @Path.GetFileName(filePath) + + + + + + } + else + { + + + @Path.GetFileName(filePath) + + + + + } } diff --git a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs index 44eaf9fc..ee5fc592 100644 --- a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs @@ -33,4 +33,12 @@ public partial class ReviewAttachmentsDialog : MSGComponentBase return dialogResult.Data as HashSet ?? documentPaths; } + + private void DeleteAttachment(string filePath) + { + if (this.DocumentPaths.Remove(filePath)) + { + this.StateHasChanged(); + } + } } \ No newline at end of file