mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Optimize query result selection handling
Refactored `QueryResultsSelected()` usage by introducing a local variable `queryResultsSelected` to avoid redundant method calls, improving efficiency and readability. Added a comment to clarify the purpose of the variable. Updated conditional logic to use the new variable instead of directly invoking the method.
This commit is contained in:
parent
f6d5a27e0b
commit
693bae7631
1 changed files with 3 additions and 1 deletions
|
|
@ -491,6 +491,8 @@ namespace Flow.Launcher.ViewModel
|
|||
[RelayCommand]
|
||||
private async Task OpenResultAsync(string index)
|
||||
{
|
||||
// Must check query results selected before executing the action
|
||||
var queryResultsSelected = QueryResultsSelected();
|
||||
var results = SelectedResults;
|
||||
if (index is not null)
|
||||
{
|
||||
|
|
@ -530,7 +532,7 @@ namespace Flow.Launcher.ViewModel
|
|||
Hide();
|
||||
}
|
||||
}
|
||||
if (QueryResultsSelected())
|
||||
if (queryResultsSelected)
|
||||
{
|
||||
_userSelectedRecord.Add(result);
|
||||
_history.Add(result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue