Skip to content

Commit 687a8b3

Browse files
authored
Code Quality: Added extra protection when navigating pages (#15868)
1 parent be81c4c commit 687a8b3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Files.App/Views/Shells/BaseShellPage.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,7 @@ public virtual void Back_Click()
567567
var previousPageContent = ItemDisplay.BackStack[ItemDisplay.BackStack.Count - 1];
568568
HandleBackForwardRequest(previousPageContent);
569569

570-
if (previousPageContent.SourcePageType == typeof(HomePage))
571-
ItemDisplay.GoBack(new EntranceNavigationTransitionInfo());
572-
else
570+
if (ItemDisplay.CanGoBack)
573571
ItemDisplay.GoBack();
574572
}
575573

@@ -578,7 +576,8 @@ public virtual void Forward_Click()
578576
var incomingPageContent = ItemDisplay.ForwardStack[ItemDisplay.ForwardStack.Count - 1];
579577
HandleBackForwardRequest(incomingPageContent);
580578

581-
ItemDisplay.GoForward();
579+
if (ItemDisplay.CanGoForward)
580+
ItemDisplay.GoForward();
582581
}
583582

584583
public void ResetNavigationStackLayoutMode()

0 commit comments

Comments
 (0)