Skip to content

Commit

Permalink
Remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Mar 3, 2023
1 parent 58b9a45 commit f0acb27
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ export default function SidebarNavigationScreenNavigationMenus() {
// This is copied from the edit component of the Navigation block.
const orderedNavigationMenus = useMemo(
() =>
navigationMenus
?.filter( ( menu ) => menu.status === 'publish' )
?.sort( ( menuA, menuB ) => {
const menuADate = new Date( menuA.date );
const menuBDate = new Date( menuB.date );
return menuADate.getTime() > menuBDate.getTime(); // This condition is the other way in the navigation block... hmmmm...
} ),
navigationMenus?.sort( ( menuA, menuB ) => {
const menuADate = new Date( menuA.date );
const menuBDate = new Date( menuB.date );
return menuADate.getTime() > menuBDate.getTime(); // This condition is the other way in the navigation block... hmmmm...
} ),
[ navigationMenus ]
);
const firstNavigationMenu = orderedNavigationMenus?.[ 0 ]?.id;
Expand Down

0 comments on commit f0acb27

Please sign in to comment.