* Fix

* Build all contexts

* Notify validator result

* Fix
This commit is contained in:
DHR60
2026-03-01 05:47:48 +00:00
committed by GitHub
parent a3ff31088e
commit 6b4ae5a386
6 changed files with 144 additions and 93 deletions
@@ -546,24 +546,15 @@ public class MainWindowViewModel : MyReactiveObject
NoticeManager.Instance.Enqueue(ResUI.CheckServerSettings);
return;
}
var (context, validatorResult) = await CoreConfigContextBuilder.Build(_config, profileItem);
var msgs = new List<string>([..validatorResult.Errors, ..validatorResult.Warnings]);
if (msgs.Count > 0)
var allResult = await CoreConfigContextBuilder.BuildAll(_config, profileItem);
if (NoticeManager.Instance.NotifyValidatorResult(allResult.CombinedValidatorResult) && !allResult.Success)
{
foreach (var msg in msgs)
{
NoticeManager.Instance.SendMessage(msg);
}
NoticeManager.Instance.Enqueue(Utils.List2String(msgs.Take(10).ToList(), true));
if (!validatorResult.Success)
{
return;
}
return;
}
await Task.Run(async () =>
{
await LoadCore(context);
await LoadCore(allResult.ResolvedMainContext, allResult.PreSocksResult?.Context);
await SysProxyHandler.UpdateSysProxy(_config, false);
await Task.Delay(1000);
});
@@ -604,9 +595,9 @@ public class MainWindowViewModel : MyReactiveObject
RxApp.MainThreadScheduler.Schedule(() => BlReloadEnabled = enabled);
}
private async Task LoadCore(CoreConfigContext? context)
private async Task LoadCore(CoreConfigContext? mainContext, CoreConfigContext? preContext)
{
await CoreManager.Instance.LoadCore(context);
await CoreManager.Instance.LoadCore(mainContext, preContext);
}
#endregion core job