fix: 尝试修复运行时下载完成更新包后卡死

This commit is contained in:
uye
2023-07-07 09:22:07 +08:00
parent feb59e0e48
commit 5cca41c19f
2 changed files with 12 additions and 6 deletions

View File

@@ -238,7 +238,7 @@ namespace MaaWpfGui.ViewModels.UI
_ = Task.Run(async () =>
{
await Task.Delay(delayTime);
await Instances.SettingsViewModel.ManualUpdate();
_ = Instances.SettingsViewModel.ManualUpdate();
});
}
}

View File

@@ -589,13 +589,19 @@ namespace MaaWpfGui.ViewModels.UI
{
if (Instances.SettingsViewModel.AutoInstallUpdatePackage)
{
while (!runningState.GetIdle())
_ = Task.Run(async () =>
{
Thread.Sleep(60000);
}
while (!runningState.GetIdle())
{
await Task.Delay(60000);
}
Application.Current.Shutdown();
Bootstrapper.RestartApplication();
Application.Current.Dispatcher.Invoke(() =>
{
Application.Current.Shutdown();
Bootstrapper.RestartApplication();
});
});
return;
}