From 48d84e5cd98b82cd7f99167907d70054ebae3cd2 Mon Sep 17 00:00:00 2001 From: wass08 Date: Thu, 26 Feb 2026 09:56:31 +0900 Subject: [PATCH] redirect to project --- .../features/community/components/project-dropdown.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/editor/features/community/components/project-dropdown.tsx b/apps/editor/features/community/components/project-dropdown.tsx index fee0a974..2fc35f27 100644 --- a/apps/editor/features/community/components/project-dropdown.tsx +++ b/apps/editor/features/community/components/project-dropdown.tsx @@ -1,6 +1,7 @@ 'use client' import { Check, ChevronDown, Home, Plus } from 'lucide-react' +import { useRouter } from 'next/navigation' import { useState } from 'react' import { DropdownMenu, @@ -18,6 +19,8 @@ import { NewProjectDialog } from './new-project-dialog' * Having it in both places caused duplicate subscriptions and 2x server action calls. */ export function ProjectDropdown() { + const router = useRouter() + // Use project store const projects = useProjectStore((state) => state.projects) const activeProject = useProjectStore((state) => state.activeProject) @@ -35,9 +38,8 @@ export function ProjectDropdown() { setIsNewProjectDialogOpen(true) } - const handleProjectCreated = async (projectId: string) => { - // Set the newly created project as active (this will also fetch projects) - await setActiveProject(projectId) + const handleProjectCreated = (projectId: string) => { + router.push(`/editor/${projectId}`) } return (