From 26322da800d49600d1b80c7aac3255b746fcdaf4 Mon Sep 17 00:00:00 2001 From: Oleksii Holub Date: Fri, 12 Apr 2019 16:24:17 +0300 Subject: [PATCH] [GUI] Notify when all exports are done instead of each of them separately --- DiscordChatExporter.Gui/ViewModels/RootViewModel.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs b/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs index a7f302a9..a9fd145f 100644 --- a/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs @@ -253,6 +253,7 @@ namespace DiscordChatExporter.Gui.ViewModels var operations = ProgressManager.CreateOperations(dialog.Channels.Count); // Export channels + var successfulExportCount = 0; for (var i = 0; i < dialog.Channels.Count; i++) { // Get operation and channel @@ -281,8 +282,8 @@ namespace DiscordChatExporter.Gui.ViewModels await _exportService.ExportChatLogAsync(chatLog, filePath, dialog.SelectedFormat, dialog.PartitionLimit); - // Notify completion - Notifications.Enqueue($"Channel [{channel.Model.Name}] successfully exported"); + // Report successful export + successfulExportCount++; } catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden) { @@ -298,6 +299,9 @@ namespace DiscordChatExporter.Gui.ViewModels operation.Dispose(); } } + + // Notify of overall completion + Notifications.Enqueue($"Successfully exported {successfulExportCount} channel(s)"); } } } \ No newline at end of file