Code quality

This commit is contained in:
Jack251970 2025-03-22 23:42:14 +08:00
parent 00ac32708c
commit 655b017e9e

View file

@ -698,16 +698,6 @@ namespace Flow.Launcher.ViewModel
Results.Visibility = Visibility.Collapsed;
_queryTextBeforeLeaveResults = QueryText;
if(HistorySelected())
{
// If we are returning from query results and we have not set select item yet,
// we need to clear the preview selected item
if (isReturningFromQueryResults && _selectedItemFromQueryResults.HasValue && _selectedItemFromQueryResults.Value)
{
PreviewSelectedItem = null;
}
}
// Because of Fody's optimization
// setter won't be called when property value is not changed.
// so we need manually call Query()
@ -720,6 +710,16 @@ namespace Flow.Launcher.ViewModel
{
QueryText = string.Empty;
}
if (HistorySelected())
{
// If we are returning from query results and we have not set select item yet,
// we need to clear the preview selected item
if (isReturningFromQueryResults && _selectedItemFromQueryResults.HasValue && _selectedItemFromQueryResults.Value)
{
PreviewSelectedItem = null;
}
}
}
_selectedResults.Visibility = Visibility.Visible;