From 6249285fc0c1025107b26420356615c4cd99acfa Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 22 Sep 2022 14:13:07 +0100 Subject: [PATCH] remove await as this doesn't need to be async --- .../src/navigation/edit/index.js | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index a02713f91f33b0..eac560559b5b80 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -265,24 +265,22 @@ function Navigation( { }, [ navigationMenus ] ); useEffect( () => { - ( async () => { - if ( - ! hasResolvedNavigationMenus || - isConvertingClassicMenu || - fallbackNavigationMenus?.length > 0 || - classicMenus?.length !== 1 - ) { - return false; - } + if ( + ! hasResolvedNavigationMenus || + isConvertingClassicMenu || + fallbackNavigationMenus?.length > 0 || + classicMenus?.length !== 1 + ) { + return false; + } - // If there's non fallback navigation menus and - // only one classic menu then create a new navigation menu based on it. - await convertClassicMenu( - classicMenus[ 0 ].id, - classicMenus[ 0 ].name, - 'publish' - ); - } )(); + // If there's non fallback navigation menus and + // only one classic menu then create a new navigation menu based on it. + convertClassicMenu( + classicMenus[ 0 ].id, + classicMenus[ 0 ].name, + 'publish' + ); }, [ hasResolvedNavigationMenus ] ); const navRef = useRef();