diff --git a/Plugins/Wox.Plugin.WebSearch/Main.cs b/Plugins/Wox.Plugin.WebSearch/Main.cs index 28d0757613..1df937d564 100644 --- a/Plugins/Wox.Plugin.WebSearch/Main.cs +++ b/Plugins/Wox.Plugin.WebSearch/Main.cs @@ -33,12 +33,13 @@ namespace Wox.Plugin.WebSearch public List Query(Query query) { + var searchSourceList = new List(); + var results = new List(); + _updateSource?.Cancel(); _updateSource = new CancellationTokenSource(); _updateToken = _updateSource.Token; - var searchSourceList = new List(); - _settings.SearchSources.Where(o => (o.ActionKeyword == query.ActionKeyword || o.ActionKeyword == SearchSourceGlobalPluginWildCardSign) && o.Enabled) .ToList() @@ -60,11 +61,10 @@ namespace Wox.Plugin.WebSearch SubTitle = string.Empty, IcoPath = searchSource.IconPath }; - return new List {result}; + results.Add(result); } else { - var results = new List(); var result = new Result { Title = title, @@ -79,13 +79,12 @@ namespace Wox.Plugin.WebSearch } }; results.Add(result); - UpdateResultsFromSuggestion(results, keyword, subtitle, searchSource, query); - return results; + UpdateResultsFromSuggestion(results, keyword, subtitle, searchSource, query); } } } - return new List(); + return results; } private void UpdateResultsFromSuggestion(List results, string keyword, string subtitle,