fix(plugins/sponsors): handle null tiers
This commit is contained in:
@@ -13,7 +13,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun
|
|||||||
const {[account]:{sponsorsListing:{fullDescription, activeGoal}, sponsorshipsAsMaintainer:{nodes, totalCount:count}}} = await graphql(queries.sponsors({login, account}))
|
const {[account]:{sponsorsListing:{fullDescription, activeGoal}, sponsorshipsAsMaintainer:{nodes, totalCount:count}}} = await graphql(queries.sponsors({login, account}))
|
||||||
const about = await imports.markdown(fullDescription, {mode:"multiline"})
|
const about = await imports.markdown(fullDescription, {mode:"multiline"})
|
||||||
const goal = activeGoal ? {progress:activeGoal.percentComplete, title:activeGoal.title, description:await imports.markdown(activeGoal.description)} : null
|
const goal = activeGoal ? {progress:activeGoal.percentComplete, title:activeGoal.title, description:await imports.markdown(activeGoal.description)} : null
|
||||||
const list = nodes.map(({sponsorEntity:{login, avatarUrl}, tier:{monthlyPriceInDollars:amount}}) => ({login, avatarUrl, amount}))
|
const list = nodes.map(({sponsorEntity:{login, avatarUrl}, tier}) => ({login, avatarUrl, amount:tier?.monthlyPriceInDollars}))
|
||||||
await Promise.all(list.map(async user => user.avatar = await imports.imgb64(user.avatarUrl)))
|
await Promise.all(list.map(async user => user.avatar = await imports.imgb64(user.avatarUrl)))
|
||||||
|
|
||||||
//Results
|
//Results
|
||||||
|
|||||||
Reference in New Issue
Block a user