mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix result update issue during modified collection enumeration
This commit is contained in:
parent
c474b304f5
commit
d8c07a5741
1 changed files with 22 additions and 15 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
|
@ -1440,26 +1440,33 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
#endif
|
||||
|
||||
foreach (var metaResults in resultsForUpdates)
|
||||
try
|
||||
{
|
||||
foreach (var result in metaResults.Results)
|
||||
foreach (var metaResults in resultsForUpdates)
|
||||
{
|
||||
if (_topMostRecord.IsTopMost(result))
|
||||
foreach (var result in metaResults.Results)
|
||||
{
|
||||
result.Score = int.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
var priorityScore = metaResults.Metadata.Priority * 150;
|
||||
result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore;
|
||||
if (_topMostRecord.IsTopMost(result))
|
||||
{
|
||||
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 (Exception ex)
|
||||
{
|
||||
Log.Debug("MainViewModel", $"Error in UpdateResultView: {ex.Message}");
|
||||
}
|
||||
|
||||
// it should be the same for all results
|
||||
bool reSelect = resultsForUpdates.First().ReSelectFirstResult;
|
||||
|
||||
Results.AddResults(resultsForUpdates, token, reSelect);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue