Skip to content

fix: GitHub stars and forks counter on landing page - #1102

Open
Axwaizee wants to merge 1 commit into
drawdb-io:mainfrom
Axwaizee:main
Open

fix: GitHub stars and forks counter on landing page#1102
Axwaizee wants to merge 1 commit into
drawdb-io:mainfrom
Axwaizee:main

Conversation

@Axwaizee

Copy link
Copy Markdown

Description

Fixes an issue on the landing page where GitHub stars and GitHub forks count displayed as 0.

The landing page previously fetched stats from a third-party worker endpoint (api.github-star-counter.workers.dev), which returns { stars: 0, forks: 0 } and overwrote the landing page state with zeroes.

Solution

  1. Official GitHub REST API: Updated fetchStats in src/pages/LandingPage.jsx to query GitHub's official repository endpoint (https://api.github.com/repos/drawdb-io/drawdb).
  2. Response Validation: Added checks for stargazers_count and forks_count to ensure only valid numeric responses update the state.
  3. Silent Error Handling: Handled network/rate-limit fetch errors silently without polluting the browser console.
  4. Updated Fallback Defaults: Updated initial state defaults to { stars: 39000, forks: 3200 } so offline / rate-limited requests render realistic counts.
  5. Formatter Improvements: Enhanced shortenNumber to handle numbers $\ge 1,000,000$ and non-number edge cases safely.

Quality & Style Check

  • Code adheres to the project's style guide and formatting rules.
  • Code passes ESLint without any warnings or errors (npm run lint).
  • Codebase remains entirely in English.

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

@Axwaizee is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant