-
Notifications
You must be signed in to change notification settings - Fork 0
fix(baseball): stop infinite loading on Events when coach has zero teams (#444) #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,6 +171,12 @@ export default function EventsPage() { | |
|
|
||
| if (teams.length > 0) { | ||
| fetchEvents(); | ||
| } else if (!authLoading) { | ||
| // Auth is ready but the coach has no teams (e.g. a new showcase org): | ||
| // clear the skeleton and fall through to the honest empty state instead | ||
| // of spinning on `loading` forever. | ||
| setEvents([]); | ||
| setLoading(false); | ||
| } | ||
|
Comment on lines
+174
to
180
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Teams-loading misread as empty The new else if (!authLoading) branch sets loading false whenever teams.length === 0, even if teams are still being fetched, so coaches with teams can briefly see the “No upcoming events” empty state before teams arrive. This occurs because useTeams() loads teams asynchronously and exposes isLoading, but EventsClient doesn’t gate the empty-teams path on it. Agent Prompt
Comment on lines
+174
to
180
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Stale fetcherror on no-teams When teams.length === 0, the new branch sets events and loading but does not reset fetchError, so an old fetch error banner can persist even though the UI is now in an expected no-teams empty state. This can happen if a fetch previously failed and teams later becomes empty in the same session. Agent Prompt
|
||
| }, [authLoading, coach?.id, teams]); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. No memory doc update
📘 Rule violation⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools