mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(api): distinguish between not enrolled and not found user statuses
This commit is contained in:
@@ -152,11 +152,19 @@ export default function App() {
|
||||
setFetchDone(true)
|
||||
return
|
||||
}
|
||||
if (r.status === 404 || status === 'not_found') {
|
||||
if (status === 'not_found') {
|
||||
// Fetcher confirmed the user doesn't exist on GitHub.
|
||||
setFetchError('User not found')
|
||||
setFetchDone(true)
|
||||
return
|
||||
}
|
||||
if (r.status === 404) {
|
||||
// 404 without status==='not_found' means the user simply isn't
|
||||
// enrolled yet (no settings row). Keep the demo data on screen
|
||||
// and stop polling — no error to display.
|
||||
setFetchDone(true)
|
||||
return
|
||||
}
|
||||
if (r.status === 429 || status === 'rate_limited') {
|
||||
setFetchError('Enrollment limit reached — try again tomorrow')
|
||||
setFetchDone(true)
|
||||
|
||||
Reference in New Issue
Block a user