diff --git a/app/(app)/ideas/page.tsx b/app/(app)/ideas/page.tsx index 679a349..1c4fd5e 100644 --- a/app/(app)/ideas/page.tsx +++ b/app/(app)/ideas/page.tsx @@ -32,6 +32,16 @@ export default async function IdeasPage() { select: { id: true, name: true, repo_url: true }, }) + const user = await prisma.user.findUnique({ + where: { id: session.userId }, + select: { active_product_id: true }, + }) + + const activeProductId = + user?.active_product_id && products.some((p) => p.id === user.active_product_id) + ? user.active_product_id + : null + return (
@@ -45,7 +55,7 @@ export default async function IdeasPage() { ideas={ideas.map((i) => ideaToDto(i))} products={products} isDemo={session.isDemo ?? false} - activeProductId={null} + activeProductId={activeProductId} />
)