@@ -31,8 +31,8 @@ public partial class MainViewModel : BaseModel, ISavable, IDisposable
31
31
32
32
private static readonly string ClassName = nameof ( MainViewModel ) ;
33
33
34
- private bool _isQueryRunning ;
35
34
private Query _lastQuery ;
35
+ private Query _runningQuery ;
36
36
private string _queryTextBeforeLeaveResults ;
37
37
38
38
private readonly FlowLauncherJsonStorage < History > _historyItemsStorage ;
@@ -1216,7 +1216,8 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1216
1216
_updateToken = _updateSource . Token ;
1217
1217
1218
1218
ProgressBarVisibility = Visibility . Hidden ;
1219
- _isQueryRunning = true ;
1219
+
1220
+ _runningQuery = query ;
1220
1221
1221
1222
// Switch to ThreadPool thread
1222
1223
await TaskScheduler . Default ;
@@ -1260,7 +1261,7 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1260
1261
_ = Task . Delay ( 200 , _updateSource . Token ) . ContinueWith ( _ =>
1261
1262
{
1262
1263
// start the progress bar if query takes more than 200 ms and this is the current running query and it didn't finish yet
1263
- if ( _isQueryRunning )
1264
+ if ( _runningQuery != null && _runningQuery == query )
1264
1265
{
1265
1266
ProgressBarVisibility = Visibility . Visible ;
1266
1267
}
@@ -1292,7 +1293,8 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1292
1293
1293
1294
// this should happen once after all queries are done so progress bar should continue
1294
1295
// until the end of all querying
1295
- _isQueryRunning = false ;
1296
+ _runningQuery = null ;
1297
+
1296
1298
if ( ! _updateSource . Token . IsCancellationRequested )
1297
1299
{
1298
1300
// update to hidden if this is still the current query
0 commit comments