From a7f4fe06438701f048d46aac053f0af990281027 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 14 Feb 2023 17:08:52 +0200 Subject: [PATCH] Don't reset output path if dialog is canceled --- .../ViewModels/Dialogs/ExportSetupViewModel.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs index 6410e7a..5264b42 100644 --- a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs @@ -101,11 +101,15 @@ public class ExportSetupViewModel : DialogScreen var extension = SelectedFormat.GetFileExtension(); var filter = $"{extension.ToUpperInvariant()} files|*.{extension}"; - OutputPath = _dialogManager.PromptSaveFilePath(filter, defaultFileName); + var outputPath = _dialogManager.PromptSaveFilePath(filter, defaultFileName); + if (!string.IsNullOrWhiteSpace(outputPath)) + OutputPath = outputPath; } else { - OutputPath = _dialogManager.PromptDirectoryPath(); + var outputPath = _dialogManager.PromptDirectoryPath(); + if (!string.IsNullOrWhiteSpace(outputPath)) + OutputPath = outputPath; } }