diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index ec07b825..5edab5d4 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -548,8 +548,11 @@ public class MainWindowViewModel : MyReactiveObject BlReloadEnabled = false; - await LoadCore(); - await SysProxyHandler.UpdateSysProxy(_config, false); + await Task.Run(async () => + { + await LoadCore(); + await SysProxyHandler.UpdateSysProxy(_config, false); + }); Locator.Current.GetService<StatusBarViewModel>()?.TestServerAvailability(); _updateView?.Invoke(EViewAction.DispatcherReload, null); diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index 4c7a5c1c..00cc391a 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -318,7 +318,10 @@ public class StatusBarViewModel : MyReactiveObject _updateView?.Invoke(EViewAction.DispatcherServerAvailability, ResUI.Speedtesting); - var msg = await (new UpdateService()).RunAvailabilityCheck(); + var msg = await Task.Run(async () => + { + return await (new UpdateService()).RunAvailabilityCheck(); + }); NoticeHandler.Instance.SendMessageEx(msg); _updateView?.Invoke(EViewAction.DispatcherServerAvailability, msg);