diff --git a/src/app/d/actions.ts b/src/app/d/actions.ts index d033b0c..1fc2b30 100644 --- a/src/app/d/actions.ts +++ b/src/app/d/actions.ts @@ -50,9 +50,13 @@ export async function getDefaultDashboardSlug(): Promise { .orderBy(asc(dashboards.position), asc(dashboards.createdAt)) .limit(1); if (first) return first.slug; - // No dashboards yet — create Home - await createDashboard("Home"); - return "home"; + // No dashboards yet — insert one directly without revalidatePath (we're in a + // render path; the redirect that follows is a fresh request anyway). + const slug = await uniqueSlug(user.id, "home"); + await db + .insert(dashboards) + .values({ userId: user.id, name: "Home", slug, isDefault: false, position: 0 }); + return slug; } export async function getDashboardBySlug(slug: string) {