Skip to content

Commit b12d246

Browse files
committed
IsGitRepository
1 parent c5c11ac commit b12d246

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Files.App/Actions/Git/GitCloneAction.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal sealed partial class GitCloneAction : ObservableObject, IAction
1313
public string Description { get; } = Strings.GitCloneDescription.GetLocalizedResource();
1414

1515
public bool IsExecutable
16-
=> pageContext.CanCreateItem;
16+
=> pageContext.CanCreateItem && !pageContext.IsGitRepository;
1717

1818
public RichGlyph Glyph
1919
=> new(themedIconStyle: "App.ThemedIcons.Git");
@@ -35,8 +35,13 @@ public Task ExecuteAsync(object? parameter = null)
3535

3636
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
3737
{
38-
if (e.PropertyName is nameof(IContentPageContext.CanCreateItem))
39-
OnPropertyChanged(nameof(IsExecutable));
38+
switch (e.PropertyName)
39+
{
40+
case nameof(IContentPageContext.CanCreateItem):
41+
case nameof(IContentPageContext.IsGitRepository):
42+
OnPropertyChanged(nameof(IsExecutable));
43+
break;
44+
}
4045
}
4146
}
4247
}

0 commit comments

Comments
 (0)