Skip to content

Commit 56d9a37

Browse files
committed
wrap the whole thing
1 parent 906d0e8 commit 56d9a37

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -429,22 +429,24 @@ private void DecreaseMaxResult()
429429
/// <param name="reQuery">Force query even when Query Text doesn't change</param>
430430
public void ChangeQueryText(string queryText, bool reQuery = false)
431431
{
432-
if (QueryText != queryText)
432+
Application.Current.Dispatcher.Invoke(() =>
433433
{
434-
Application.Current.Dispatcher.Invoke(() =>
434+
if (QueryText != queryText)
435435
{
436+
436437
// re-query is done in QueryText's setter method
437438
QueryText = queryText;
438439
// set to false so the subsequent set true triggers
439440
// PropertyChanged and MoveQueryTextToEnd is called
440441
QueryTextCursorMovedToEnd = false;
441-
});
442-
}
443-
else if (reQuery)
444-
{
445-
Query();
446-
}
447-
QueryTextCursorMovedToEnd = true;
442+
443+
}
444+
else if (reQuery)
445+
{
446+
Query();
447+
}
448+
QueryTextCursorMovedToEnd = true;
449+
});
448450
}
449451

450452
public bool LastQuerySelected { get; set; }

0 commit comments

Comments
 (0)