Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/server/sponsors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,25 @@ async function getGithubSponsors() {
console.error(
'Invalid or missing GitHub credentials, returning mock data.',
)
return [
'tannerlinsley',
'tkdodo',
'crutchcorn',
'kevinvandy',
'jherr',
'seancassiere',
'schiller-manuel',
].flatMap((d) =>
new Array(20).fill(d).map((_, i2) => ({
login: d,
name: d,
amount: (20 - i2) / 20 + Math.random(),
createdAt: new Date().toISOString(),
private: false,
linkUrl: `https://github.com/${d}`,
imageUrl: `https://github.com/${d}.png`,
})),
)
const mockSponsors = [
'tannerlinsley',
'tkdodo',
'crutchcorn',
'kevinvandy',
'jherr',
'seancassiere',
'schiller-manuel',
]

return mockSponsors.map((d, i) => ({
login: d,
name: d,
amount: mockSponsors.length - i,
createdAt: new Date().toISOString(),
private: false,
linkUrl: `https://github.com/${d}`,
imageUrl: `https://github.com/${d}.png`,
}))
}
if (error.status === 403) {
console.error('GitHub rate limit exceeded, returning empty sponsors.')
Expand Down
38 changes: 19 additions & 19 deletions src/utils/sponsors.functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,25 @@ async function getGithubSponsors() {
console.error(
'Invalid or missing GitHub credentials, returning mock data.',
)
return [
'tannerlinsley',
'tkdodo',
'crutchcorn',
'kevinvandy',
'jherr',
'seancassiere',
'schiller-manuel',
].flatMap((d) =>
new Array(20).fill(d).map((_, i2) => ({
login: d,
name: d,
amount: (20 - i2) / 20 + Math.random(),
createdAt: new Date().toISOString(),
private: false,
linkUrl: `https://github.com/${d}`,
imageUrl: `https://github.com/${d}.png`,
})),
)
const mockSponsors = [
'tannerlinsley',
'tkdodo',
'crutchcorn',
'kevinvandy',
'jherr',
'seancassiere',
'schiller-manuel',
]

return mockSponsors.map((d, i) => ({
login: d,
name: d,
amount: mockSponsors.length - i,
createdAt: new Date().toISOString(),
private: false,
linkUrl: `https://github.com/${d}`,
imageUrl: `https://github.com/${d}.png`,
}))
}

if (error.status === 403) {
Expand Down