diff --git a/packages/ui/src/components/Command/CommandMenu.tsx b/packages/ui/src/components/Command/CommandMenu.tsx index fc0f31dfb6b..11619e4c2c6 100644 --- a/packages/ui/src/components/Command/CommandMenu.tsx +++ b/packages/ui/src/components/Command/CommandMenu.tsx @@ -65,11 +65,6 @@ const CommandMenu = ({ projectRef }: CommandMenuProps) => { useCommandMenu() const showCommandInput = !currentPage || !CHAT_ROUTES.includes(currentPage) - const handleRouteChange = (url: string) => { - router.push(url) - setIsOpen(false) - } - return ( <> { handleRouteChange(itemUrl)} + onSelect={() => { + router.push(item.url) + setIsOpen(false) + }} >