Skip to content

Commit

Permalink
Amend back route from single Nav Menu to Nav Listing
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed May 1, 2024
1 parent 6f9769a commit a95b5c1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import { SidebarNavigationContext } from '../sidebar';
const { useHistory, useLocation } = unlock( routerPrivateApis );

function getBackPath( params ) {
// Navigation Menus are not currently part of a data view.
// Therefore when navigating back from a navigation menu
// the target path is the navigation listing view.
if ( params.path === '/navigation' && params.postId ) {
return { path: '/navigation' };
}

// From a data view path we navigate back to root
if ( params.path ) {
return {};
Expand Down

0 comments on commit a95b5c1

Please sign in to comment.