From 54994ddb7b264c51452e13dac7f7306b9fc44f41 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 3 May 2025 17:02:39 +0800 Subject: [PATCH] Initialize home query when window is loaded --- Flow.Launcher/MainWindow.xaml.cs | 3 +++ Flow.Launcher/ViewModel/MainViewModel.cs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index ae7b098a2..546f32cc5 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -292,6 +292,9 @@ namespace Flow.Launcher DependencyPropertyDescriptor .FromProperty(VisibilityProperty, typeof(StackPanel)) .AddValueChanged(History, (s, e) => UpdateClockPanelVisibility()); + + // Initialize query state + _viewModel.InitializeQuery(); } private async void OnClosing(object sender, CancelEventArgs e) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index b5afe4b7e..8244d5765 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1074,6 +1074,14 @@ namespace Flow.Launcher.ViewModel #region Query + public void InitializeQuery() + { + if (Settings.ShowHomeQuery) + { + _ = QueryResultsAsync(false); + } + } + public void Query(bool searchDelay, bool isReQuery = false) { if (QueryResultsSelected())