From 67d41fbdc44b97fc357afbe3317941d55df29632 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:41:36 +0300 Subject: [PATCH] Fix jitter in the GUI when switching from DM guild to any other and back --- .../ViewModels/Components/DashboardViewModel.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs index 98e4969..9ef563a 100644 --- a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs @@ -70,6 +70,17 @@ public class DashboardViewModel : PropertyChangedBase o => o.Current, (_, _) => NotifyOfPropertyChange(() => IsProgressIndeterminate) ); + + this.Bind( + o => o.SelectedGuild, + (_, _) => + { + // Reset channels when the selected guild changes, to avoid jitter + // due to the channels being asynchronously loaded. + AvailableChannels = null; + SelectedChannels = null; + } + ); } public void OnViewLoaded()