Skip to content

Commit dc446a2

Browse files
committed
skip backers with no sponsor information
1 parent 1b93319 commit dc446a2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/theme/BackerBanner/index.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ async function getBackers() {
4646

4747
const backersToDisplay = selectRandom(validBackers)
4848

49-
return backersToDisplay.map(function (backer) {
49+
return backersToDisplay.reduce(function (results, backer) {
50+
if (!backer.sponsor) {
51+
return results;
52+
}
53+
5054
const {
5155
name,
5256
openCollectiveHandle,
@@ -68,14 +72,16 @@ async function getBackers() {
6872

6973
let usersName = name || githubHandle || twitterHandle || openCollectiveHandle || '';
7074

71-
return {
75+
results.push({
7276
key: href,
7377
src: avatarUrl,
7478
alt: usersName,
7579
title: monthlyAmount ? `Thank you ${usersName} for the $${monthlyAmount}/month!` : `Thank you ${usersName} for the support!`,
7680
href: href,
77-
};
78-
});
81+
});
82+
83+
return results;
84+
}, []);
7985
}
8086

8187
function Backer({ backer }) {

0 commit comments

Comments
 (0)