From c0b9c65a727a8fa3a47eb63e0ffc2655b8ea2e40 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:32:47 -0400 Subject: [PATCH] Code Quality: Added extra protection when navigating pages --- src/Files.App/Views/Shells/BaseShellPage.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Files.App/Views/Shells/BaseShellPage.cs b/src/Files.App/Views/Shells/BaseShellPage.cs index 42f2bd43ce1e..ce051e9d6cc3 100644 --- a/src/Files.App/Views/Shells/BaseShellPage.cs +++ b/src/Files.App/Views/Shells/BaseShellPage.cs @@ -567,9 +567,7 @@ public virtual void Back_Click() var previousPageContent = ItemDisplay.BackStack[ItemDisplay.BackStack.Count - 1]; HandleBackForwardRequest(previousPageContent); - if (previousPageContent.SourcePageType == typeof(HomePage)) - ItemDisplay.GoBack(new EntranceNavigationTransitionInfo()); - else + if (ItemDisplay.CanGoBack) ItemDisplay.GoBack(); } @@ -578,7 +576,8 @@ public virtual void Forward_Click() var incomingPageContent = ItemDisplay.ForwardStack[ItemDisplay.ForwardStack.Count - 1]; HandleBackForwardRequest(incomingPageContent); - ItemDisplay.GoForward(); + if (ItemDisplay.CanGoForward) + ItemDisplay.GoForward(); } public void ResetNavigationStackLayoutMode()