fix: Always allow next round button to be clickable when players disconnect #2136
+6
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix issue where players couldn't advance to the next round when someone lost their connection during gameplay.
Solution
Removed the conditional disabling of the Next Round button in the player interface. The server-side
next_roundhandler already has proper validation logic to handle cases where not all players have played their cards, making the client-side disabling unnecessary and problematic for disconnected players.Related Issues
Closes: #2129
Changes Made
copi.owasp.org/lib/copi_web/live/player_live/show.html.heexclassanddisabledattributes that depended onround_open?(@game)<.primary_button class={if round_open?(@game) do "bg-zinc-900/15 pointer-events-none" end} disabled={round_open?(@game)} phx-click="next_round" phx-value-game_id={@game.id}><.primary_button phx-click="next_round" phx-value-game_id={@game.id}>Benefits
Testing
The change leverages existing server-side validation in
copi.owasp.org/lib/copi_web/live/player_live/show.ex(lines 24-28) which already handles cases where not all players have played, ensuring the game state remains consistent.