mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix issue that plugin will cannot cache records
This commit is contained in:
parent
2ffe170407
commit
9850e9d3eb
1 changed files with 11 additions and 2 deletions
|
|
@ -1196,9 +1196,18 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
currentCancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
results ??= _emptyResult;
|
||||
IReadOnlyList<Result> resultsCopy;
|
||||
if (results == null)
|
||||
{
|
||||
resultsCopy = _emptyResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
// make a copy of results to avoid possible issue that FL changes some properties of the records, like score, etc.
|
||||
resultsCopy = DeepCloneResults(results);
|
||||
}
|
||||
|
||||
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(results, plugin.Metadata, query,
|
||||
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, plugin.Metadata, query,
|
||||
currentCancellationToken, reSelect)))
|
||||
{
|
||||
Log.Error("MainViewModel", "Unable to add item to Result Update Queue");
|
||||
|
|
|
|||
Loading…
Reference in a new issue