fix: handle undefined socialLinks in ProfileCard component
This commit is contained in:
parent
5faafd477b
commit
996eb4339e
@ -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
|
||||
|
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user