This commit is contained in:
sepia 2025-07-19 18:34:53 -05:00
parent 1f19022d45
commit 742bd4f106
8 changed files with 49 additions and 62 deletions

View file

@ -12,9 +12,8 @@ export function renderGameBoardHtml(
let boardHtml = '<div id="game-board" class="game-board-grid">';
const currentPlayerColor =
Object.entries(gameState.players).find(
([_, id]) => id === playerId,
)?.[0] || null;
Object.entries(gameState.players).find(([_, id]) => id === playerId)?.[0] ||
null;
const isPlayersTurn =
gameState.status === 'playing' &&
gameState.currentPlayer === currentPlayerColor;
@ -30,9 +29,7 @@ export function renderGameBoardHtml(
}
// HTMX attributes for making a move
const wsAttrs = isPlayersTurn && !stone
? `ws-send="click"`
: '';
const wsAttrs = isPlayersTurn && !stone ? `ws-send="click"` : '';
boardHtml += `
<div