diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 6e7e183c..7a127fa7 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -709,18 +709,22 @@ public class ProfilesViewModel : MyReactiveObject public async Task ServerSpeedtest(ESpeedActionType actionType) { - if (actionType == ESpeedActionType.Mixedtest) + List? lstSelected; + if (actionType is ESpeedActionType.Mixedtest or ESpeedActionType.FastRealping) { - SelectedProfiles = ProfileItems; + if (actionType == ESpeedActionType.FastRealping) + { + actionType = ESpeedActionType.Realping; + } + + lstSelected = JsonUtils.Deserialize>(JsonUtils.Serialize(ProfileItems?.OrderBy(t => t.Sort))); } - else if (actionType == ESpeedActionType.FastRealping) + else { - SelectedProfiles = ProfileItems; - actionType = ESpeedActionType.Realping; + lstSelected = await GetProfileItems(false); } - var lstSelected = await GetProfileItems(false); - if (lstSelected == null) + if (lstSelected is null || lstSelected.Count <= 0) { return; }