From e722927d9e0e1e2dd72359cc11cc80b7a54dc24b Mon Sep 17 00:00:00 2001 From: AminSallah <124622454+AminSallah@users.noreply.github.com> Date: Sun, 25 Feb 2024 04:05:54 +0200 Subject: [PATCH] ReQuery method overloading, reselect flag. --- Flow.Launcher/ViewModel/MainViewModel.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index ab93e08e2..6e53879f8 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -33,6 +33,7 @@ namespace Flow.Launcher.ViewModel #region Private Fields private bool _isQueryRunning; + private bool _reselect = true; private Query _lastQuery; private Result lastContextMenuResult = new Result(); private List lastContextMenuResults = new List(); @@ -216,6 +217,15 @@ namespace Flow.Launcher.ViewModel } } + public void ReQuery(bool reselect) + { + if (SelectedIsFromQueryResults()) + { + _reselect = reselect; + QueryResults(isReQuery: true); + } + } + [RelayCommand] private void LoadContextMenu() { @@ -1151,7 +1161,8 @@ namespace Flow.Launcher.ViewModel } } - Results.AddResults(resultsForUpdates, token); + Results.AddResults(resultsForUpdates, token, _reselect); + _reselect = true; } #endregion