Use null instead of undefined

This commit is contained in:
Austin Chen 2022-07-25 17:18:26 -07:00
parent c74f178bcb
commit 9e7e2bbde6

View File

@ -38,7 +38,7 @@ export async function getStaticProps() {
const matches = quadraticMatches(txns, totalRaised) const matches = quadraticMatches(txns, totalRaised)
const numDonors = uniqBy(txns, (txn) => txn.fromId).length const numDonors = uniqBy(txns, (txn) => txn.fromId).length
const donorId = last(txns)?.fromId const donorId = last(txns)?.fromId
const mostRecentDonor = donorId ? await getUser(donorId) : undefined const mostRecentDonor = donorId ? await getUser(donorId) : null
return { return {
props: { props: {
@ -91,7 +91,7 @@ export default function Charity(props: {
matches: { [charityId: string]: number } matches: { [charityId: string]: number }
txns: Txn[] txns: Txn[]
numDonors: number numDonors: number
mostRecentDonor?: User mostRecentDonor?: User | null
}) { }) {
const { totalRaised, charities, matches, numDonors, mostRecentDonor } = props const { totalRaised, charities, matches, numDonors, mostRecentDonor } = props