From d4391925a2d7e50357ffb0e44e802c4f65ed3ee7 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Fri, 14 Apr 2023 09:21:01 -0230 Subject: [PATCH] Move to inline --- packages/ui/src/components/Command/CommandMenu.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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) + }} >