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