Skip to content

Comments

Replace track switch cooldown with race-activity check#39

Merged
LinaBell merged 1 commit intomainfrom
dev
Feb 12, 2026
Merged

Replace track switch cooldown with race-activity check#39
LinaBell merged 1 commit intomainfrom
dev

Conversation

@LinaBell
Copy link
Contributor

Summary

  • Replaced the 30-minute track switch cooldown (based on trackLastSwitchedDate) with a 5-minute check based on lastRaceStartedDate, which records when any user last started a race
  • Non-admins are blocked from switching tracks if a race was started < 5 minutes ago (disabled button with tooltip)
  • Admins see a confirmation modal warning that a race may be in progress but can proceed
  • Removed trackLastSwitchedDate from the client state and switch track flow

Test plan

  • Start a race and confirm lastRaceStartedDate is set on the world data object
  • As a non-admin, navigate to Switch Track within 5 minutes of a race starting — button should be disabled with a hover tooltip
  • As an admin, navigate to Switch Track within 5 minutes — button is enabled, clicking shows a confirmation modal warning about active races
  • Wait 5+ minutes after last race start — any user can switch tracks freely with no restrictions

@LinaBell LinaBell merged commit 6fa0161 into main Feb 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant