fix: handle undefined socialLinks in ProfileCard component

This commit is contained in:
Akhileshrangani4 2025-01-06 06:31:30 -05:00
parent 5faafd477b
commit 996eb4339e
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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 (