mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Revert fix in MainViewModel & Fix possible issue in WebSearch plugin
This commit is contained in:
parent
0c43ea9379
commit
9a7c08b1cd
2 changed files with 15 additions and 24 deletions
|
|
@ -1447,35 +1447,26 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
#endif
|
||||
|
||||
try
|
||||
foreach (var metaResults in resultsForUpdates)
|
||||
{
|
||||
foreach (var metaResults in resultsForUpdates)
|
||||
foreach (var result in metaResults.Results)
|
||||
{
|
||||
foreach (var result in metaResults.Results)
|
||||
if (_topMostRecord.IsTopMost(result))
|
||||
{
|
||||
if (_topMostRecord.IsTopMost(result))
|
||||
{
|
||||
result.Score = int.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
var priorityScore = metaResults.Metadata.Priority * 150;
|
||||
result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore;
|
||||
}
|
||||
result.Score = int.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
var priorityScore = metaResults.Metadata.Priority * 150;
|
||||
result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore;
|
||||
}
|
||||
}
|
||||
|
||||
// it should be the same for all results
|
||||
bool reSelect = resultsForUpdates.First().ReSelectFirstResult;
|
||||
|
||||
Results.AddResults(resultsForUpdates, token, reSelect);
|
||||
}
|
||||
catch (InvalidOperationException e)
|
||||
{
|
||||
// Plugin with IResultUpdate interface can somtimes throw this exception
|
||||
// Collection was modified; enumeration operation may not execute
|
||||
Log.Exception($"{nameof(MainViewModel)}.{nameof(UpdateResultView)}|UpdateResultView failed", e);
|
||||
}
|
||||
|
||||
// it should be the same for all results
|
||||
bool reSelect = resultsForUpdates.First().ReSelectFirstResult;
|
||||
|
||||
Results.AddResults(resultsForUpdates, token, reSelect);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
|
||||
ResultsUpdated?.Invoke(this, new ResultUpdatedEventArgs
|
||||
{
|
||||
Results = results,
|
||||
Results = results.ToList(),
|
||||
Query = query
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue