Skip to content

Commit

Permalink
Fix: Fixed showOpenWithMenu not working (#11325)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishitetsu authored Feb 16, 2023
1 parent 0eb8ac0 commit f62ed5b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Files.App/Helpers/ShellContextMenuHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,15 @@ public static async Task LoadShellMenuItems(string path, CommandBarFlyout itemCo

if (showOpenWithMenu)
{
var openWithItem = shellMenuItems.Where(x => (x.Tag as Win32ContextMenuItem)?.ID == 100).ToList().FirstOrDefault();
var (_, openWithItems) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(new List<ContextMenuFlyoutItemViewModel>() { openWithItem });
itemContextMenuFlyout.SecondaryCommands.Insert(0, openWithItems.FirstOrDefault());
var openWithItem = shellMenuItems.Where(x => (x.Tag as Win32ContextMenuItem)?.CommandString == "openas").ToList().FirstOrDefault();
if (openWithItem is not null)
{
var (_, openWithItems) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(new List<ContextMenuFlyoutItemViewModel>() { openWithItem });
itemContextMenuFlyout.SecondaryCommands.Insert(0, openWithItems.FirstOrDefault());
shellMenuItems.Remove(openWithItem);
}
}

if (!UserSettingsService.PreferencesSettingsService.MoveShellExtensionsToSubMenu)
{
var (_, secondaryElements) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(shellMenuItems);
Expand Down

0 comments on commit f62ed5b

Please sign in to comment.