diff --git a/packages/core-data/src/reducer.js b/packages/core-data/src/reducer.js index 9748355fc5caf6..6eb792facbd675 100644 --- a/packages/core-data/src/reducer.js +++ b/packages/core-data/src/reducer.js @@ -583,6 +583,18 @@ export function navigationFallbackId( state = null, action ) { switch ( action.type ) { case 'RECEIVE_NAVIGATION_FALLBACK_ID': return action.fallbackId; + case 'REMOVE_ITEMS': + // if the kind is postType + // and the type if `wp_navigation` + // and the item is the fallback id + // then remove the fallback id + if ( + action.kind === 'postType' && + action.name === 'wp_navigation' && + state === action.itemIds[ 0 ] + ) { + return null; + } } return state; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js index 11635c6c6abb12..4138280c2ba28e 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js @@ -42,7 +42,7 @@ function useDeleteNavigationMenu() { type: 'snackbar', } ); - history.navivate( '/navigation' ); + history.navigate( '/navigation' ); } catch ( error ) { createErrorNotice( sprintf(