From 52b778c990f0fca4ef90e8d4b09dc42f9e296bb6 Mon Sep 17 00:00:00 2001 From: krut_ni Date: Tue, 28 Jul 2026 17:38:45 +0200 Subject: [PATCH] exchanging the old word export with the new document export --- .../Chat/ContentBlockComponent.razor.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/MindWork AI Studio/Chat/ContentBlockComponent.razor.cs b/app/MindWork AI Studio/Chat/ContentBlockComponent.razor.cs index 0dcb910c..9021cc1d 100644 --- a/app/MindWork AI Studio/Chat/ContentBlockComponent.razor.cs +++ b/app/MindWork AI Studio/Chat/ContentBlockComponent.razor.cs @@ -33,6 +33,8 @@ public partial class ContentBlockComponent : MSGComponentBase, IAsyncDisposable " /// The role of the chat content block. @@ -546,9 +548,17 @@ public partial class ContentBlockComponent : MSGComponentBase, IAsyncDisposable await this.RemoveBlockFunc(this.Content); } - private async Task ExportToWord() + private async Task ExportDocument(FileExportFormat format) { - await PandocExport.ToMicrosoftWord(this.RustService, this.DialogService, T("Export Chat to Microsoft Word"), this.Content); + try + { + await PandocExport.ToDocument(this.RustService, this.DialogService, format, this.Content); + } + catch (ArgumentOutOfRangeException e) + { + await this.MessageBus.SendError(new(Icons.Material.Filled.Error, string.Format(this.T("Failed to export document to unknown file format '{0}'."), format))); + LOGGER.LogError($"Failed to export document, because the format ('{format}') is unknown to our Pandoc service:\n{e}"); + } } private async Task RegenerateBlock()