diff --git a/src/server/sponsors.ts b/src/server/sponsors.ts index 2666ad63..6cc75c42 100644 --- a/src/server/sponsors.ts +++ b/src/server/sponsors.ts @@ -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.') diff --git a/src/utils/sponsors.functions.ts b/src/utils/sponsors.functions.ts index 917941c2..f9dfa6ab 100644 --- a/src/utils/sponsors.functions.ts +++ b/src/utils/sponsors.functions.ts @@ -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) {