Add "Put Back" button to cancel accidental discard draws
When you accidentally click the discard pile, you can now put the card back instead of being forced to swap. The "Put Back" button appears only when you've drawn from the discard pile. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -748,6 +748,14 @@ async def websocket_endpoint(websocket: WebSocket):
|
||||
# Turn ended, check for CPU
|
||||
await check_and_run_cpu_turn(current_room)
|
||||
|
||||
elif msg_type == "cancel_draw":
|
||||
if not current_room:
|
||||
continue
|
||||
|
||||
async with current_room.game_lock:
|
||||
if current_room.game.cancel_discard_draw(player_id):
|
||||
await broadcast_game_state(current_room)
|
||||
|
||||
elif msg_type == "flip_card":
|
||||
if not current_room:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user