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 { and, eq, sql } from "drizzle-orm"
import * as schema from "./schema" import * as schema from "./schema"
import { Sandbox, sandbox, user, usersToSandboxes } from "./schema" import { Sandbox, sandbox, sandboxLikes, user, usersToSandboxes } from "./schema"
export interface Env { export interface Env {
DB: D1Database DB: D1Database

View File

@ -135,7 +135,7 @@ function ProfileCard({
isOwnProfile, isOwnProfile,
bio, bio,
personalWebsite, personalWebsite,
socialLinks, socialLinks = [],
tier, tier,
}: { }: {
name: string name: string
@ -178,7 +178,7 @@ function ProfileCard({
}, [sandboxes]) }, [sandboxes])
const showAddMoreInfoBanner = useMemo(() => { const showAddMoreInfoBanner = useMemo(() => {
return !bio && !personalWebsite && socialLinks.length === 0 return !bio && !personalWebsite && (socialLinks?.length ?? 0) === 0
}, [personalWebsite, bio, socialLinks]) }, [personalWebsite, bio, socialLinks])
return ( return (