diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index f9a5c481057bc3..fe1ded1896357c 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -544,7 +544,7 @@ function Navigation( { } selectBlock( clientId ); } } - onCreateEmpty={ () => createNavigationMenu( [] ) } + onCreateEmpty={ () => createNavigationMenu( '', [] ) } /> ); diff --git a/packages/block-library/src/navigation/edit/use-create-navigation-menu.js b/packages/block-library/src/navigation/edit/use-create-navigation-menu.js index 723cc18f70c14c..41a2fea97420a5 100644 --- a/packages/block-library/src/navigation/edit/use-create-navigation-menu.js +++ b/packages/block-library/src/navigation/edit/use-create-navigation-menu.js @@ -27,13 +27,13 @@ export default function useCreateNavigationMenu( clientId ) { // This callback uses data from the two placeholder steps and only creates // a new navigation menu when the user completes the final step. const create = useCallback( - ( title = null, blocks = [] ) => { + async ( title = null, blocks = [] ) => { setStatus( PENDING ); setValue( null ); setError( null ); if ( ! title ) { - title = generateDefaultTitle().catch( ( err ) => { + title = await generateDefaultTitle().catch( ( err ) => { setError( err?.message ); setStatus( ERROR ); throw new Error(