From 136acbd7e96c8907af9f01e680cdd2f5a4953272 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 27 Mar 2025 18:49:36 +0800 Subject: [PATCH 1/2] Remove useless delay --- Flow.Launcher/ViewModel/MainViewModel.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 9b2ad2d40fa..aa18d8008dc 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1554,8 +1554,6 @@ await Application.Current.Dispatcher.InvokeAsync(() => Win32Helper.RestorePreviousKeyboardLayout(); } - await Task.Delay(50); - // Update WPF properties //MainWindowOpacity = 0; MainWindowVisibilityStatus = false; From 3c3064ae46b0db15002662c928249bb8ae168247 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 27 Mar 2025 19:01:48 +0800 Subject: [PATCH 2/2] Fix QueryText null exception --- Flow.Launcher/ViewModel/MainViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index aa18d8008dc..2bfc9587c6e 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1458,7 +1458,8 @@ await Application.Current.Dispatcher.InvokeAsync(() => mainWindow.ClockPanel.Opacity = opacity; mainWindow.SearchIcon.Opacity = opacity; - if (QueryText.Length != 0) + // QueryText sometimes is null when it is just initialized + if (QueryText != null && QueryText.Length != 0) { mainWindow.ClockPanel.Visibility = Visibility.Collapsed; }