Skip to content

Commit 94a0477

Browse files
committed
fix merge issue of result update event
1 parent 8bd6820 commit 94a0477

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ private void RegisterResultsUpdatedEvent()
122122
{
123123
foreach (var pair in PluginManager.GetPluginsForInterface<IResultUpdated>())
124124
{
125-
var plugin = (IResultUpdated) pair.Plugin;
125+
var plugin = (IResultUpdated)pair.Plugin;
126126
plugin.ResultsUpdated += (s, e) =>
127127
{
128-
Task.Run(() =>
128+
if (e.Query.RawQuery == QueryText) // TODO: allow cancellation
129129
{
130130
PluginManager.UpdatePluginMetadata(e.Results, pair.Metadata, e.Query);
131-
UpdateResultView(e.Results, pair.Metadata, e.Query);
132-
}, _updateToken);
131+
_resultsUpdateQueue.Post(new ResultsForUpdate(e.Results, pair.Metadata, e.Query, _updateToken));
132+
}
133133
};
134134
}
135135
}
@@ -379,7 +379,7 @@ private void QueryHistory()
379379
Title = string.Format(title, h.Query),
380380
SubTitle = string.Format(time, h.ExecutedDateTime),
381381
IcoPath = "Images\\history.png",
382-
OriginQuery = new Query {RawQuery = h.Query},
382+
OriginQuery = new Query { RawQuery = h.Query },
383383
Action = _ =>
384384
{
385385
SelectedResults = Results;

0 commit comments

Comments
 (0)