From 90d71c5b9ee9be98c405e59b5a9cfc75b8cbbdaf Mon Sep 17 00:00:00 2001
From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Date: Mon, 10 Jul 2023 20:40:23 +0300
Subject: [PATCH] Clean up
---
.../Utils/Extensions/BinaryExtensions.cs | 4 ++--
DiscordChatExporter.Gui/Services/SettingsService.cs | 3 +++
.../ViewModels/Components/DashboardViewModel.cs | 11 +++++++++--
.../Views/Dialogs/SettingsView.xaml | 8 ++++----
4 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/DiscordChatExporter.Core/Utils/Extensions/BinaryExtensions.cs b/DiscordChatExporter.Core/Utils/Extensions/BinaryExtensions.cs
index 434a2a72..86efab0d 100644
--- a/DiscordChatExporter.Core/Utils/Extensions/BinaryExtensions.cs
+++ b/DiscordChatExporter.Core/Utils/Extensions/BinaryExtensions.cs
@@ -8,8 +8,8 @@ public static class BinaryExtensions
{
var buffer = new StringBuilder(2 * data.Length);
- foreach (var t in data)
- buffer.Append(t.ToString("X2"));
+ foreach (var b in data)
+ buffer.Append(b.ToString("X2"));
return buffer.ToString();
}
diff --git a/DiscordChatExporter.Gui/Services/SettingsService.cs b/DiscordChatExporter.Gui/Services/SettingsService.cs
index 8b8a519d..79cf78e5 100644
--- a/DiscordChatExporter.Gui/Services/SettingsService.cs
+++ b/DiscordChatExporter.Gui/Services/SettingsService.cs
@@ -46,10 +46,13 @@ public partial class SettingsService : SettingsBase
public override void Save()
{
// Clear the token if it's not supposed to be persisted
+ var lastToken = LastToken;
if (!IsTokenPersisted)
LastToken = null;
base.Save();
+
+ LastToken = lastToken;
}
}
diff --git a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
index 1d8b36a7..c8e20f10 100644
--- a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
@@ -65,8 +65,15 @@ public class DashboardViewModel : PropertyChangedBase
_progressMuxer = Progress.CreateMuxer().WithAutoReset();
- this.Bind(o => o.IsBusy, (_, _) => NotifyOfPropertyChange(() => IsProgressIndeterminate));
- Progress.Bind(o => o.Current, (_, _) => NotifyOfPropertyChange(() => IsProgressIndeterminate));
+ this.Bind(
+ o => o.IsBusy,
+ (_, _) => NotifyOfPropertyChange(() => IsProgressIndeterminate)
+ );
+
+ Progress.Bind(
+ o => o.Current,
+ (_, _) => NotifyOfPropertyChange(() => IsProgressIndeterminate)
+ );
}
public void OnViewLoaded()
diff --git a/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml b/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml
index b00d5510..232a9e03 100644
--- a/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml
+++ b/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml
@@ -19,7 +19,7 @@
@@ -71,7 +71,7 @@
Margin="16,8"
Background="Transparent"
LastChildFill="False"
- ToolTip="Save last used token in a file so that it can be persisted between sessions">
+ ToolTip="Save the last used token to a file so that it can be persisted between sessions">
-
+