From 3927d5829044f5a07fd45d4d370338edba5968f1 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Fri, 14 Apr 2023 22:02:48 +0200 Subject: [PATCH] Show channel name if not in predefined lists --- Bloxstrap/ViewModels/InstallationViewModel.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/ViewModels/InstallationViewModel.cs b/Bloxstrap/ViewModels/InstallationViewModel.cs index 9607870..86cee6d 100644 --- a/Bloxstrap/ViewModels/InstallationViewModel.cs +++ b/Bloxstrap/ViewModels/InstallationViewModel.cs @@ -76,7 +76,13 @@ namespace Bloxstrap.ViewModels public IEnumerable Channels { - get => _channels; + get + { + if (_channels == DeployManager.ChannelsAll && !_channels.Contains(App.Settings.Prop.Channel)) + _channels = _channels.Append(App.Settings.Prop.Channel); + + return _channels; + } set => _channels = value; } @@ -103,8 +109,12 @@ namespace Bloxstrap.ViewModels else { Channels = DeployManager.ChannelsAbstracted; - Channel = DeployManager.DefaultChannel; - OnPropertyChanged(nameof(Channel)); + + if (!Channels.Contains(Channel)) + { + Channel = DeployManager.DefaultChannel; + OnPropertyChanged(nameof(Channel)); + } } OnPropertyChanged(nameof(Channels));