Skip to content

Commit 44f739a

Browse files
committed
that's better
1 parent f3d9fc2 commit 44f739a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/modules/cmdpal/Core/Microsoft.CmdPal.Core.ViewModels/CommandBarViewModel.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,14 @@ private void UpdateContextItems()
9696

9797
SecondaryCommand = SelectedItem.SecondaryCommand;
9898

99-
ShouldShowContextMenu = SelectedItem.MoreCommands
100-
.OfType<CommandContextItemViewModel>()
101-
.Count() > 1;
99+
var hasMoreThanOneContextItem = SelectedItem.MoreCommands.Count() > 1;
100+
var hasMoreThanOneCommand = SelectedItem.MoreCommands.OfType<CommandContextItemViewModel>().Any();
101+
102+
// ShouldShowContextMenu = SelectedItem.MoreCommands
103+
104+
// // .OfType<CommandContextItemViewModel>()
105+
// .Count() > 1;
106+
ShouldShowContextMenu = hasMoreThanOneContextItem && hasMoreThanOneCommand;
102107

103108
OnPropertyChanged(nameof(HasSecondaryCommand));
104109
OnPropertyChanged(nameof(SecondaryCommand));

0 commit comments

Comments
 (0)