Skip to content

Commit

Permalink
remove await as this doesn't need to be async
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Sep 22, 2022
1 parent 3e0fb33 commit 77dafd0
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 77dafd0

Please sign in to comment.