From 996eb4339ef467e16096115ba069ef31472b4990 Mon Sep 17 00:00:00 2001 From: Akhileshrangani4 Date: Mon, 6 Jan 2025 06:31:30 -0500 Subject: [PATCH] fix: handle undefined socialLinks in ProfileCard component --- backend/database/src/index.ts | 2 +- frontend/components/profile/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/database/src/index.ts b/backend/database/src/index.ts index db4f5e6..17ed7f0 100644 --- a/backend/database/src/index.ts +++ b/backend/database/src/index.ts @@ -5,7 +5,7 @@ import { z } from "zod" import { and, eq, sql } from "drizzle-orm" import * as schema from "./schema" -import { Sandbox, sandbox, user, usersToSandboxes } from "./schema" +import { Sandbox, sandbox, sandboxLikes, user, usersToSandboxes } from "./schema" export interface Env { DB: D1Database diff --git a/frontend/components/profile/index.tsx b/frontend/components/profile/index.tsx index 39ebdee..6e1fa73 100644 --- a/frontend/components/profile/index.tsx +++ b/frontend/components/profile/index.tsx @@ -135,7 +135,7 @@ function ProfileCard({ isOwnProfile, bio, personalWebsite, - socialLinks, + socialLinks = [], tier, }: { name: string @@ -178,7 +178,7 @@ function ProfileCard({ }, [sandboxes]) const showAddMoreInfoBanner = useMemo(() => { - return !bio && !personalWebsite && socialLinks.length === 0 + return !bio && !personalWebsite && (socialLinks?.length ?? 0) === 0 }, [personalWebsite, bio, socialLinks]) return (