Skip to content

Commit 72b0fbf

Browse files
committed
Add code comments
1 parent cc7dc4a commit 72b0fbf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,15 @@ public void ReQuery()
298298
{
299299
if (QueryResultsSelected())
300300
{
301+
// When we are requerying, we should not delay the query
301302
_ = QueryResultsAsync(false, isReQuery: true);
302303
}
303304
}
304305

305306
public void ReQuery(bool reselect)
306307
{
307308
BackToQueryResults();
309+
// When we are requerying, we should not delay the query
308310
_ = QueryResultsAsync(false, isReQuery: true, reSelect: reselect);
309311
}
310312

@@ -649,14 +651,16 @@ private async Task ChangeQueryTextAsync(string queryText, bool isReQuery = false
649651
{
650652
// re-query is done in QueryText's setter method
651653
QueryText = queryText;
652-
await QueryAsync(searchDelay: false, isReQuery: false);
654+
// When we are changing query from codes, we should not delay the query
655+
await QueryAsync(false, isReQuery: false);
653656
// set to false so the subsequent set true triggers
654657
// PropertyChanged and MoveQueryTextToEnd is called
655658
QueryTextCursorMovedToEnd = false;
656659
}
657660
else if (isReQuery)
658661
{
659-
await QueryAsync(searchDelay: false, isReQuery: true);
662+
// When we are requerying, we should not delay the query
663+
await QueryAsync(false, isReQuery: true);
660664
}
661665

662666
QueryTextCursorMovedToEnd = true;
@@ -726,6 +730,7 @@ private ResultsViewModel SelectedResults
726730
// so we need manually call Query()
727731
// http://stackoverflow.com/posts/25895769/revisions
728732
QueryText = string.Empty;
733+
// When we are changing query from selected results, we should not delay the query
729734
Query(false);
730735

731736
if (HistorySelected())

0 commit comments

Comments
 (0)