Skip to content

Commit

Permalink
fix(sponsors): Update octokit, fix null (#3576)
Browse files Browse the repository at this point in the history
* fix(sponsors): Work around `tier` being `null`

* format

* fix(sponsors): Update octokit, fix null
  • Loading branch information
fb55 authored Jan 2, 2024
1 parent 8b1089b commit 220e3e9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 81 deletions.
137 changes: 59 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"devDependencies": {
"@imgix/js-core": "^3.8.0",
"@octokit/graphql": "^6.0.1",
"@octokit/graphql": "^7.0.2",
"@types/benchmark": "^2.1.5",
"@types/jest": "^29.5.11",
"@types/jsdom": "^21.1.6",
Expand Down
4 changes: 2 additions & 2 deletions scripts/fetch-sponsors.mts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ async function fetchGitHubSponsors(): Promise<Sponsor[]> {
sponsor.isViewer === undefined ? 'ORGANIZATION' : 'INDIVIDUAL',
monthlyDonation: (tier?.monthlyPriceInDollars ?? 0) * 100,
totalDonations:
getMonthsActive(createdAt) * tier.monthlyPriceInDollars * 100,
getMonthsActive(createdAt) * tier?.monthlyPriceInDollars * 100,
source: 'github',
tier: getTierSlug(tier?.monthlyPriceInDollars ?? 0),
}),
Expand Down Expand Up @@ -262,7 +262,7 @@ const professionalToBackerOverrides = new Map([

const sponsors = await fetchSponsors();

// Remove sponsors that are already in the pre-propulated headliners
// Remove sponsors that are already in the pre-populated headliners
for (let i = 0; i < sponsors.length; i++) {
if (
tierSponsors.headliner.some((sponsor) => sponsor.url === sponsors[i].url)
Expand Down

0 comments on commit 220e3e9

Please sign in to comment.