Show channel name if not in predefined lists

This commit is contained in:
pizzaboxer 2023-04-14 22:02:48 +02:00
parent 45f760bc14
commit 3927d58290
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -76,7 +76,13 @@ namespace Bloxstrap.ViewModels
public IEnumerable<string> Channels public IEnumerable<string> 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; set => _channels = value;
} }
@ -103,9 +109,13 @@ namespace Bloxstrap.ViewModels
else else
{ {
Channels = DeployManager.ChannelsAbstracted; Channels = DeployManager.ChannelsAbstracted;
if (!Channels.Contains(Channel))
{
Channel = DeployManager.DefaultChannel; Channel = DeployManager.DefaultChannel;
OnPropertyChanged(nameof(Channel)); OnPropertyChanged(nameof(Channel));
} }
}
OnPropertyChanged(nameof(Channels)); OnPropertyChanged(nameof(Channels));