mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-17 18:55:01 +03:00
Code clean (#9482)
This commit is contained in:
@@ -67,7 +67,7 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||
this.WhenAnyValue(
|
||||
x => x.SelectedGroup,
|
||||
y => y != null && y.Name.IsNotEmpty())
|
||||
.Subscribe(c => RefreshProxyDetails(c));
|
||||
.Subscribe(RefreshProxyDetails);
|
||||
|
||||
this.WhenAnyValue(
|
||||
x => x.RuleModeSelected,
|
||||
@@ -77,7 +77,7 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||
this.WhenAnyValue(
|
||||
x => x.SortingSelected,
|
||||
y => y >= 0)
|
||||
.Subscribe(c => DoSortingSelected(c));
|
||||
.Subscribe(DoSortingSelected);
|
||||
|
||||
this.WhenAnyValue(
|
||||
x => x.AutoRefresh,
|
||||
@@ -188,15 +188,14 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||
ProxyGroups.Clear();
|
||||
|
||||
var proxyGroups = ClashApiManager.Instance.GetClashProxyGroups();
|
||||
if (proxyGroups != null && proxyGroups.Count > 0)
|
||||
if (proxyGroups is { Count: > 0 })
|
||||
{
|
||||
foreach (var it in proxyGroups)
|
||||
{
|
||||
if (it.name.IsNullOrEmpty() || !_proxies.ContainsKey(it.name))
|
||||
if (it.name.IsNullOrEmpty() || !_proxies.TryGetValue(it.name, out var item))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var item = _proxies[it.name];
|
||||
if (!Global.allowSelectType.Contains(item.type.ToLower()))
|
||||
{
|
||||
continue;
|
||||
@@ -230,7 +229,7 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||
});
|
||||
}
|
||||
|
||||
if (ProxyGroups != null && ProxyGroups.Count > 0)
|
||||
if (ProxyGroups is { Count: > 0 })
|
||||
{
|
||||
if (selectedName != null && ProxyGroups.Any(t => t.Name == selectedName))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user