From df3cb58c6c2bac0f71e73a003f99b04a881d83d1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 11 Jan 2025 12:38:08 +0800 Subject: [PATCH] Improve code quality --- Flow.Launcher/ProgressBoxEx.xaml.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Flow.Launcher/ProgressBoxEx.xaml.cs b/Flow.Launcher/ProgressBoxEx.xaml.cs index 37ee2b0cb..a04ed0576 100644 --- a/Flow.Launcher/ProgressBoxEx.xaml.cs +++ b/Flow.Launcher/ProgressBoxEx.xaml.cs @@ -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();