feat: loosen up the zod validations and return null instead of throwing
This commit is contained in:
@@ -16,16 +16,19 @@ async function CurrentPointsBalance({
|
||||
}: AccountPageComponentProps) {
|
||||
const user = await serverClient().user.get()
|
||||
const { formatMessage } = await getIntl()
|
||||
if (!user) {
|
||||
return null
|
||||
}
|
||||
const membership = getMembership(user.memberships)
|
||||
return (
|
||||
<div>
|
||||
<Header title={title} link={link} subtitle={subtitle} />
|
||||
|
||||
<div className={styles.card}>
|
||||
<h2>{`${formatMessage({ id: "Total points" })}*`}</h2>
|
||||
<p
|
||||
className={styles.points}
|
||||
>{`${formatMessage({ id: "Points" })}: ${membership?.currentPoints || "N/A"}`}</p>
|
||||
<h2>{`${formatMessage({ id: "Total Points" })}*`}</h2>
|
||||
<p className={styles.points}>
|
||||
{`${formatMessage({ id: "Points" })}: ${membership?.currentPoints || "N/A"}`}
|
||||
</p>
|
||||
<p className={styles.disclaimer}>
|
||||
{`*${formatMessage({ id: "Points may take up to 10 days to be displayed." })}`}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user