Skip to content

Commit

Permalink
Merge pull request #3115 from Jack251970/dev2
Browse files Browse the repository at this point in the history
  • Loading branch information
taooceros authored Dec 25, 2024
2 parents 3d8cf29 + 26d97a2 commit 21f22e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ private void RegisterResultsUpdatedEvent()

var token = e.Token == default ? _updateToken : e.Token;

PluginManager.UpdatePluginMetadata(e.Results, pair.Metadata, e.Query);
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(e.Results, pair.Metadata, e.Query,
// make a copy of results to avoid plugin change the result when updating view model
var resultsCopy = e.Results.ToList();

PluginManager.UpdatePluginMetadata(resultsCopy, pair.Metadata, e.Query);
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, pair.Metadata, e.Query,
token)))
{
Log.Error("MainViewModel", "Unable to add item to Result Update Queue");
Expand Down

0 comments on commit 21f22e6

Please sign in to comment.