diff options
| author | Aaron Iker <[email protected]> | 2026-01-15 21:31:50 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-15 21:31:50 +0100 |
| commit | fe58c649cb83c73c3f2c3094682189ffa78ccc4f (patch) | |
| tree | 660898bc090b38ddff5faccdf0c9598aa0db9726 /packages/console/app/src/lib/github.ts | |
| parent | af2a09940c5b411c27f72c039a0351a3c19efd02 (diff) | |
| download | opencode-fe58c649cb83c73c3f2c3094682189ffa78ccc4f.tar.gz opencode-fe58c649cb83c73c3f2c3094682189ffa78ccc4f.zip | |
feat(console): Update /black plan selection, light rays effect. mobile styles (#8731)
Co-authored-by: Github Action <[email protected]>
Diffstat (limited to 'packages/console/app/src/lib/github.ts')
| -rw-r--r-- | packages/console/app/src/lib/github.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/console/app/src/lib/github.ts b/packages/console/app/src/lib/github.ts index cc266f58c..ccde5972d 100644 --- a/packages/console/app/src/lib/github.ts +++ b/packages/console/app/src/lib/github.ts @@ -14,13 +14,14 @@ export const github = query(async () => { fetch(`${apiBaseUrl}/releases`, { headers }).then((res) => res.json()), fetch(`${apiBaseUrl}/contributors?per_page=1`, { headers }), ]) + if (!Array.isArray(releases) || releases.length === 0) { + return undefined + } const [release] = releases - const contributorCount = Number.parseInt( - contributors.headers - .get("Link")! - .match(/&page=(\d+)>; rel="last"/)! - .at(1)!, - ) + const linkHeader = contributors.headers.get("Link") + const contributorCount = linkHeader + ? Number.parseInt(linkHeader.match(/&page=(\d+)>; rel="last"/)?.at(1) ?? "0") + : 0 return { stars: meta.stargazers_count, release: { |
