Improve code quality

This commit is contained in:
Jack251970 2025-01-11 12:38:08 +08:00
parent cc921c7d29
commit df3cb58c6c

View file

@ -46,12 +46,9 @@ namespace Flow.Launcher
{
if (!Application.Current.Dispatcher.CheckAccess())
{
await Application.Current.Dispatcher.InvokeAsync(async () =>
await Application.Current.Dispatcher.InvokeAsync(() =>
{
if (prgBox != null)
{
await prgBox.CloseAsync();
}
prgBox?.Close();
});
}
}
@ -80,17 +77,6 @@ namespace Flow.Launcher
}
}
private async Task CloseAsync()
{
if (!Application.Current.Dispatcher.CheckAccess())
{
await Application.Current.Dispatcher.InvokeAsync(Close);
return;
}
Close();
}
private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
{
ForceClose();