History items filtered based on HistoryStyle.

This commit is contained in:
01Dri 2025-10-14 22:51:09 -03:00
parent d5a2695766
commit 9f652c33b4

View file

@ -1318,9 +1318,10 @@ namespace Flow.Launcher.ViewModel
private List<Result> GetHistoryItems(IEnumerable<LastOpenedHistoryItem> historyItems) private List<Result> GetHistoryItems(IEnumerable<LastOpenedHistoryItem> historyItems)
{ {
var results = new List<Result>(); var results = new List<Result>();
var historyItemsFiltered = historyItems.Where(x => x.HistoryStyle == Settings.HistoryStyle).ToList();
if (Settings.HistoryStyle == HistoryStyle.Query) if (Settings.HistoryStyle == HistoryStyle.Query)
{ {
foreach (var h in historyItems) foreach (var h in historyItemsFiltered)
{ {
var result = new Result var result = new Result
{ {
@ -1341,7 +1342,7 @@ namespace Flow.Launcher.ViewModel
} }
else else
{ {
foreach (var h in historyItems) foreach (var h in historyItemsFiltered)
{ {
var result = new Result var result = new Result
{ {
@ -1364,15 +1365,14 @@ namespace Flow.Launcher.ViewModel
{ {
await reflectResult.AsyncAction(c); await reflectResult.AsyncAction(c);
} }
return false; return false;
} }
else
{ App.API.BackToQueryResults();
App.API.BackToQueryResults(); App.API.ChangeQuery(h.Query);
App.API.ChangeQuery(h.Query); return false;
return false; },
}
},
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uE81C") Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uE81C")
}; };
results.Add(result); results.Add(result);