Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/Files.App/Views/ShellPanesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public sealed partial class ShellPanesPage : Page, IShellPanesPage, ITabBarItemC
// Fields

private bool _wasRightPaneVisible;
private NavigationParams? _savedNavParamsRight;

// Properties

Expand Down Expand Up @@ -105,15 +106,25 @@ public bool WindowIsCompact
// Close pane
_wasRightPaneVisible = GetPaneCount() >= 2;

if (GetPaneCount() >= 2)
if (_wasRightPaneVisible)
{
var currentPath = GetPane(1)?.TabBarItemParameter?.NavigationParameter as string ?? "Home";
_savedNavParamsRight = new NavigationParams { NavPath = currentPath };
RemovePane(1);
}
}
else if (_wasRightPaneVisible)
{
// Add back pane
if (GetPaneCount() == 1)
AddPane();

if (_savedNavParamsRight is not null)
{
NavParamsRight = _savedNavParamsRight;
_savedNavParamsRight = null;
}

_wasRightPaneVisible = false;
}

Expand Down
Loading