Skip to content

Commit 42fbe2e

Browse files
committed
Clean up
1 parent 2123808 commit 42fbe2e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Files.App/Actions/Navigation/CloseAllTabsAction.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ public override string Description
1414
public override HotKey HotKey
1515
=> new(Keys.W, KeyModifiers.CtrlShift);
1616

17-
public override bool IsExecutable
18-
=> context.Control is not null;
19-
2017
public CloseAllTabsAction()
2118
{
2219
}
2320

21+
protected override bool GetIsExecutable()
22+
{
23+
return
24+
context.Control is not null &&
25+
context.TabCount > 0 &&
26+
context.CurrentTabItem is not null;
27+
}
28+
2429
public override Task ExecuteAsync(object? parameter = null)
2530
{
2631
if (context.Control is not null)

src/Files.App/Actions/Navigation/CloseTabBaseAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal abstract class CloseTabBaseAction : ObservableObject, IAction
1111

1212
public abstract string Description { get; }
1313

14-
public virtual bool IsExecutable
14+
public bool IsExecutable
1515
=> GetIsExecutable();
1616

1717
public virtual HotKey HotKey

0 commit comments

Comments
 (0)