Skip to content

Commit

Permalink
Fix: Fixed issue where Git buttons were incorrectly shown in the stat…
Browse files Browse the repository at this point in the history
…us bar (#12703)
  • Loading branch information
ferrariofilippo authored Jun 23, 2023
1 parent 342b761 commit 682bd3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Files.App/UserControls/StatusBarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
x:Name="GitActionsPanel"
Grid.Column="1"
VerticalAlignment="Center"
x:Load="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToFalseConverter}}"
x:Load="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}"
Orientation="Horizontal"
Spacing="4">

Expand Down Expand Up @@ -214,7 +214,7 @@
Background="Transparent"
BorderBrush="Transparent"
ToolTipService.ToolTip="{helpers:ResourceString Name=ManageBranches}"
Visibility="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToVisibilityCollapsedConverter}}">
Visibility="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToVisibilityCollapsedConverter}, FallbackValue=Collapsed}">

<Button.Content>
<StackPanel Orientation="Horizontal" Spacing="8">
Expand Down
5 changes: 4 additions & 1 deletion src/Files.App/UserControls/StatusBarControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed partial class StatusBarControl : UserControl
{
public ICommandManager Commands { get; } = Ioc.Default.GetRequiredService<ICommandManager>();

public DirectoryPropertiesViewModel DirectoryPropertiesViewModel
public DirectoryPropertiesViewModel? DirectoryPropertiesViewModel
{
get => (DirectoryPropertiesViewModel)GetValue(DirectoryPropertiesViewModelProperty);
set => SetValue(DirectoryPropertiesViewModelProperty, value);
Expand Down Expand Up @@ -47,6 +47,9 @@ public StatusBarControl()

private void BranchesFlyout_Opening(object sender, object e)
{
if (DirectoryPropertiesViewModel is null)
return;

DirectoryPropertiesViewModel.ShowLocals = true;
DirectoryPropertiesViewModel.SelectedBranchIndex = DirectoryPropertiesViewModel.ACTIVE_BRANCH_INDEX;
}
Expand Down

0 comments on commit 682bd3c

Please sign in to comment.