mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
CmdPal: Filtering out pinned apps on search (#40785)
Closes #40781 Filters out TopLevelCommands whose Id matches an app coming from the `AllAppsCommandProvider.Page.GetItems()`. Hate adding processing there, but without adding some type of `bool HideMeOnSearch` to something low enough (like ICommandItem), I don't see another way to distinguish these.
This commit is contained in:
@@ -164,6 +164,11 @@ public partial class MainListPage : DynamicListPage,
|
||||
if (_includeApps)
|
||||
{
|
||||
IEnumerable<IListItem> apps = AllAppsCommandProvider.Page.GetItems();
|
||||
var appIds = apps.Select(app => app.Command.Id).ToArray();
|
||||
|
||||
// Remove any top level pinned apps and use the apps from AllAppsCommandProvider.Page.GetItems()
|
||||
// since they contain details.
|
||||
_filteredItems = _filteredItems.Where(item => item.Command is not AppCommand);
|
||||
_filteredItems = _filteredItems.Concat(apps);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user