From d83e9a3be49fbf48014bf7bb42e6f02cadbe64df Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Mon, 20 May 2024 11:14:21 +0900 Subject: [PATCH] Command Palette: Remove unused url parameter --- .../src/site-editor-navigation-commands.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/core-commands/src/site-editor-navigation-commands.js b/packages/core-commands/src/site-editor-navigation-commands.js index 410a3e875a8df..6ef9be58b4d00 100644 --- a/packages/core-commands/src/site-editor-navigation-commands.js +++ b/packages/core-commands/src/site-editor-navigation-commands.js @@ -26,7 +26,7 @@ import { useIsBlockBasedTheme } from './hooks'; import { unlock } from './lock-unlock'; import { orderEntityRecordsBySearch } from './utils/order-entity-records-by-search'; -const { useHistory, useLocation } = unlock( routerPrivateApis ); +const { useHistory } = unlock( routerPrivateApis ); const icons = { post, @@ -160,14 +160,6 @@ const getNavigationCommandLoaderPerPostType = ( postType ) => const getNavigationCommandLoaderPerTemplate = ( templateType ) => function useNavigationCommandLoader( { search } ) { const history = useHistory(); - const location = useLocation(); - - const isPatternsPage = - location?.params?.path === '/patterns' || - location?.params?.postType === 'wp_block'; - const didAccessPatternsPage = - !! location?.params?.didAccessPatternsPage; - const isBlockBasedTheme = useIsBlockBasedTheme(); const { records, isLoading } = useSelect( ( select ) => { const { getEntityRecords } = select( coreStore ); @@ -223,11 +215,6 @@ const getNavigationCommandLoaderPerTemplate = ( templateType ) => const args = { postType: templateType, postId: record.id, - didAccessPatternsPage: - ! isBlockBasedTheme && - ( isPatternsPage || didAccessPatternsPage ) - ? 1 - : undefined, ...extraArgs, }; const targetUrl = addQueryArgs(