Skip to content

Commit 9eb7c9c

Browse files
committed
Wait last query to be canceled and then do resetting actions
1 parent 20b5c47 commit 9eb7c9c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,16 +1200,20 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
12001200

12011201
if (query == null) // shortcut expanded
12021202
{
1203+
// Wait last query to be canceled and then do resetting actions
1204+
await _updateLock.WaitAsync(CancellationToken.None);
1205+
try
1206+
{
1207+
// Reset the results
12031208
Results.Clear();
12041209
Results.Visibility = Visibility.Collapsed;
1210+
1211+
// Reset the plugin icon
12051212
PluginIconPath = null;
12061213
PluginIconSource = null;
12071214
SearchIconVisibility = Visibility.Visible;
12081215

1209-
// Wait last query to be canceled and hide progress bar
1210-
await _updateLock.WaitAsync(CancellationToken.None);
1211-
try
1212-
{
1216+
// Reset the progress bar
12131217
ProgressBarVisibility = Visibility.Hidden;
12141218
}
12151219
finally

0 commit comments

Comments
 (0)