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 { 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
|
||||||
|
@ -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 (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user