mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 05:03:02 +00:00
Scroll to new group node
This commit is contained in:
parent
8f2e83618f
commit
10a53fc48e
1 changed files with 8 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
private string _serverFilter = string.Empty;
|
private string _serverFilter = string.Empty;
|
||||||
private Dictionary<string, bool> _dicHeaderSort = new();
|
private Dictionary<string, bool> _dicHeaderSort = new();
|
||||||
private SpeedtestService? _speedtestService;
|
private SpeedtestService? _speedtestService;
|
||||||
|
private string? _pendingSelectIndexId;
|
||||||
|
|
||||||
#endregion private prop
|
#endregion private prop
|
||||||
|
|
||||||
|
|
@ -362,15 +363,14 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
ProfileItems.AddRange(lstModel);
|
ProfileItems.AddRange(lstModel);
|
||||||
if (lstModel.Count > 0)
|
if (lstModel.Count > 0)
|
||||||
{
|
{
|
||||||
var selected = lstModel.FirstOrDefault(t => t.IndexId == _config.IndexId);
|
ProfileItemModel? selected = null;
|
||||||
if (selected != null)
|
if (!_pendingSelectIndexId.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
SelectedProfile = selected;
|
selected = lstModel.FirstOrDefault(t => t.IndexId == _pendingSelectIndexId);
|
||||||
}
|
_pendingSelectIndexId = null;
|
||||||
else
|
|
||||||
{
|
|
||||||
SelectedProfile = lstModel.First();
|
|
||||||
}
|
}
|
||||||
|
selected ??= lstModel.FirstOrDefault(t => t.IndexId == _config.IndexId);
|
||||||
|
SelectedProfile = selected ?? lstModel.First();
|
||||||
}
|
}
|
||||||
|
|
||||||
await _updateView?.Invoke(EViewAction.DispatcherRefreshServersBiz, null);
|
await _updateView?.Invoke(EViewAction.DispatcherRefreshServersBiz, null);
|
||||||
|
|
@ -619,6 +619,7 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
NoticeManager.Instance.Enqueue(ResUI.OperationFailed);
|
NoticeManager.Instance.Enqueue(ResUI.OperationFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
_pendingSelectIndexId = ret.Data?.ToString();
|
||||||
await RefreshServers();
|
await RefreshServers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue