From f4a2086dfb98704c798aa8de351888ca5802644b Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 22 May 2026 10:07:36 +0800 Subject: [PATCH] Refine reload logic after RefreshServers https://github.com/2dust/v2rayN/issues/9344 --- .../ServiceLib/ViewModels/MainWindowViewModel.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index da798a8b..4b3f41b9 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -304,10 +304,22 @@ public class MainWindowViewModel : MyReactiveObject { var indexIdOld = _config.IndexId; await RefreshServers(); - if (indexIdOld != _config.IndexId) + + // If indexId changed or subIndexId is empty, directly reload. + if (indexIdOld != _config.IndexId || _config.SubIndexId.IsNullOrEmpty()) { await Reload(); } + else + { + // The activity config belongs to the current group. + var profile = await AppManager.Instance.GetProfileItem(_config.IndexId); + if (profile != null && profile.Subid == _config.SubIndexId) + { + await Reload(); + } + } + if (_config.UiItem.EnableAutoAdjustMainLvColWidth) { AppEvents.AdjustMainLvColWidthRequested.Publish();