mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-27 09:02:07 +03:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user