diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 9b2ad2d40fa..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; } @@ -1554,8 +1555,6 @@ await Application.Current.Dispatcher.InvokeAsync(() => Win32Helper.RestorePreviousKeyboardLayout(); } - await Task.Delay(50); - // Update WPF properties //MainWindowOpacity = 0; MainWindowVisibilityStatus = false;