Use cancallationToken.IsCancellationRequested instead of comparing current token with global token

This commit is contained in:
弘韬 张 2021-01-02 21:20:21 +08:00
parent 6326d6f3d5
commit 7be2a956dd

View file

@ -442,7 +442,8 @@ namespace Flow.Launcher.ViewModel
async Task QueryTask(PluginPair plugin, Query query, CancellationToken token)
{
var results = await PluginManager.QueryForPlugin(plugin, query, token);
UpdateResultView(results, plugin.Metadata, query);
if (!currentCancellationToken.IsCancellationRequested)
UpdateResultView(results, plugin.Metadata, query);
}
}, currentCancellationToken).ContinueWith(t => Log.Exception("|MainViewModel|Plugins Query Exceptions", t.Exception),