Set SelectedIndex to 0 after delayed execution of plugins

This commit is contained in:
Stefan Markovic
2021-10-08 18:51:47 +02:00
parent 2c58475d61
commit 5397d0f1fa

View File

@@ -615,7 +615,7 @@ namespace PowerLauncher.ViewModel
} }
currentCancellationToken.ThrowIfCancellationRequested(); currentCancellationToken.ThrowIfCancellationRequested();
UpdateResultsListViewAfterQuery(queryText, true); UpdateResultsListViewAfterQuery(queryText);
} }
} }
catch (OperationCanceledException) catch (OperationCanceledException)
@@ -656,7 +656,7 @@ namespace PowerLauncher.ViewModel
} }
} }
private void UpdateResultsListViewAfterQuery(string queryText, bool isDelayedInvoke = false) private void UpdateResultsListViewAfterQuery(string queryText)
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() => Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{ {
@@ -669,10 +669,7 @@ namespace PowerLauncher.ViewModel
if (Results.Results.Count > 0) if (Results.Results.Count > 0)
{ {
Results.Visibility = Visibility.Visible; Results.Visibility = Visibility.Visible;
if (!isDelayedInvoke) Results.SelectedIndex = 0;
{
Results.SelectedIndex = 0;
}
} }
else else
{ {