From 6d3adf9fdea8f23f1683b63b98f41278741d161e Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 14 Feb 2023 19:34:20 +0200 Subject: [PATCH] Trigger output path prompt when clicking the export button, if the path hasn't been set yet --- .../ViewModels/Dialogs/ExportSetupViewModel.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs index 5264b42..da2648a 100644 --- a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs @@ -113,10 +113,18 @@ public class ExportSetupViewModel : DialogScreen } } - public bool CanConfirm => !string.IsNullOrWhiteSpace(OutputPath); - public void Confirm() { + // Prompt the output path if it's not set yet + if (string.IsNullOrWhiteSpace(OutputPath)) + { + ShowOutputPathPrompt(); + + // If the output path is still not set, cancel the export + if (string.IsNullOrWhiteSpace(OutputPath)) + return; + } + // Persist preferences _settingsService.LastExportFormat = SelectedFormat; _settingsService.LastPartitionLimitValue = PartitionLimitValue;