Skip to content

BaseballHelm: Stop infinite loading on Events when coach has zero teams #444

Description

@njrini99-code

Problem

EventsClient initializes loading to true but only calls fetchEvents() when teams.length > 0. A showcase coach with no teams never clears loading.

Evidence

  • src/app/baseball/(dashboard)/dashboard/events/EventsClient.tsx line 107: useState(true)
    if (teams.length > 0) {
      fetchEvents();
    }
  }, [authLoading, coach?.id, teams]);

When teams is [] and auth is ready, fetchEvents never runs and loading stays true.

Why it matters

The Events page is stuck on a skeleton forever for new showcase orgs — a broken empty state.

Acceptance criteria

  • When auth is ready and teams.length === 0, set loading false and show the empty state.
  • No perpetual "Loading…" subtitle/header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    baseballBaseballHelmbugIncorrect behavior or regression

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions