Skip to content

Commit 23eeb8f

Browse files
committed
Try to fix
#7128
1 parent 456ffb2 commit 23eeb8f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,11 @@ public async Task Reload()
548548

549549
BlReloadEnabled = false;
550550

551-
await LoadCore();
552-
await SysProxyHandler.UpdateSysProxy(_config, false);
551+
await Task.Run(async () =>
552+
{
553+
await LoadCore();
554+
await SysProxyHandler.UpdateSysProxy(_config, false);
555+
});
553556
Locator.Current.GetService<StatusBarViewModel>()?.TestServerAvailability();
554557

555558
_updateView?.Invoke(EViewAction.DispatcherReload, null);

v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ public async Task TestServerAvailability()
318318

319319
_updateView?.Invoke(EViewAction.DispatcherServerAvailability, ResUI.Speedtesting);
320320

321-
var msg = await (new UpdateService()).RunAvailabilityCheck();
321+
var msg = await Task.Run(async () =>
322+
{
323+
return await (new UpdateService()).RunAvailabilityCheck();
324+
});
322325

323326
NoticeHandler.Instance.SendMessageEx(msg);
324327
_updateView?.Invoke(EViewAction.DispatcherServerAvailability, msg);

0 commit comments

Comments
 (0)