Skip to content

Commit 3f0c142

Browse files
committed
Fix hide window startup issue
1 parent fe62a03 commit 3f0c142

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,13 @@ public void ChangeQueryText(string queryText, bool isReQuery = false)
638638
/// </summary>
639639
private async Task ChangeQueryTextAsync(string queryText, bool isReQuery = false)
640640
{
641-
await Application.Current.Dispatcher.InvokeAsync(async () =>
641+
// Must check access so that we will not block the UI thread which cause window visibility issue
642+
if (!Application.Current.Dispatcher.CheckAccess())
642643
{
644+
await Application.Current.Dispatcher.InvokeAsync(() => ChangeQueryText(queryText, isReQuery));
645+
return;
646+
}
647+
643648
BackToQueryResults();
644649

645650
if (QueryText != queryText)
@@ -656,7 +661,6 @@ await Application.Current.Dispatcher.InvokeAsync(async () =>
656661
}
657662

658663
QueryTextCursorMovedToEnd = true;
659-
});
660664
}
661665

662666
public bool LastQuerySelected { get; set; }

0 commit comments

Comments
 (0)