Skip to content

Commit f4a2086

Browse files
committed
Refine reload logic after RefreshServers
2dust#9344
1 parent ccb0ffb commit f4a2086

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,22 @@ private async Task UpdateTaskHandler(bool success, string msg)
304304
{
305305
var indexIdOld = _config.IndexId;
306306
await RefreshServers();
307-
if (indexIdOld != _config.IndexId)
307+
308+
// If indexId changed or subIndexId is empty, directly reload.
309+
if (indexIdOld != _config.IndexId || _config.SubIndexId.IsNullOrEmpty())
308310
{
309311
await Reload();
310312
}
313+
else
314+
{
315+
// The activity config belongs to the current group.
316+
var profile = await AppManager.Instance.GetProfileItem(_config.IndexId);
317+
if (profile != null && profile.Subid == _config.SubIndexId)
318+
{
319+
await Reload();
320+
}
321+
}
322+
311323
if (_config.UiItem.EnableAutoAdjustMainLvColWidth)
312324
{
313325
AppEvents.AdjustMainLvColWidthRequested.Publish();

0 commit comments

Comments
 (0)