Skip to content

Commit b82eea9

Browse files
committed
Assign last state after all queries are done
1 parent 1ae0dd2 commit b82eea9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ public void RegisterResultsUpdatedEvent()
283283
_shouldClearExistingResults = true;
284284
}
285285
}
286-
_lastQuery = e.Query;
287-
_previousIsHomeQuery = currentIsHomeQuery;
288286

289287
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, pair.Metadata, e.Query,
290288
token)))
@@ -1394,6 +1392,10 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
13941392
// nothing to do here
13951393
}
13961394

1395+
// after all queries are done, we will update the last state
1396+
_lastQuery = query;
1397+
_previousIsHomeQuery = currentIsHomeQuery;
1398+
13971399
if (currentCancellationToken.IsCancellationRequested) return;
13981400

13991401
// this should happen once after all queries are done so progress bar should continue
@@ -1463,8 +1465,6 @@ await PluginManager.QueryHomeForPluginAsync(plugin, query, token) :
14631465
_shouldClearExistingResults = true;
14641466
}
14651467
}
1466-
_lastQuery = query;
1467-
_previousIsHomeQuery = currentIsHomeQuery;
14681468

14691469
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, plugin.Metadata, query,
14701470
token, reSelect)))
@@ -1494,8 +1494,6 @@ void QueryHistoryTask(CancellationToken token)
14941494
_shouldClearExistingResults = true;
14951495
}
14961496
}
1497-
_lastQuery = query;
1498-
_previousIsHomeQuery = currentIsHomeQuery;
14991497

15001498
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(results, _historyMetadata, query,
15011499
token, reSelect)))

0 commit comments

Comments
 (0)