Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Apr 4, 2023
1 parent 2c983f9 commit d39da99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion clashN/clashN/ViewModels/ProxiesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ private void GetClashProxies(bool refreshUI)

private void RefreshProxyGroups()
{
var selectedName = SelectedGroup?.name;
_proxyGroups.Clear();

var proxyGroups = MainFormHandler.Instance.GetClashProxyGroups();
Expand Down Expand Up @@ -283,7 +284,14 @@ private void RefreshProxyGroups()

if (_proxyGroups != null && _proxyGroups.Count > 0)
{
SelectedGroup = _proxyGroups[0];
if (selectedName != null && _proxyGroups.Any(t => t.name == selectedName))
{
SelectedGroup = _proxyGroups.FirstOrDefault(t => t.name == selectedName);
}
else
{
SelectedGroup = _proxyGroups[0];
}
}
else
{
Expand Down

0 comments on commit d39da99

Please sign in to comment.