clear pages when clicking on a page in the command dialog
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m29s

This commit is contained in:
Lee 2024-04-22 17:20:54 +01:00
parent e277645333
commit 782b5efd4b

@ -97,8 +97,9 @@ export function CommandMenu({ ...props }: ButtonProps): ReactElement {
<CommandItem
key={page.slug}
onSelect={() => {
router.push(`/docs/${page.slug}`);
setOpen(false);
router.push(`/docs/${page.slug}`); // Go to the page
setOpen(false); // Close the dialog
setPages(undefined); // Clear the pages
}}
className="flex flex-col items-start gap-1"
>