From 965e314d3bca38c258c61c97090ed1a312fd86e6 Mon Sep 17 00:00:00 2001 From: Chris Karle Date: Mon, 3 Mar 2025 21:34:41 -0500 Subject: [PATCH] fix(Spectator) fix bug if spectator not last Modifies lobby-processing logic so that after the fourth player has taken a seat, any remain spectators have their local view updated to position the view behind player4. Old code could leave some variables uninitialized if a spectator was in before the final seat was taken. --- assets/components/CardTable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/components/CardTable.js b/assets/components/CardTable.js index 1c4d3d4..37cb35a 100644 --- a/assets/components/CardTable.js +++ b/assets/components/CardTable.js @@ -255,8 +255,9 @@ export default class CardTable extends React.Component { if (msg.game.players) { const plAr = msg.game.players; let mySeat = plAr.findIndex( x => x == name ); - console.log('initMySeat.mySeat=', mySeat); - if (newSpec && msg.game.phase != 'lobby'){ + let anyEmpty = plAr.includes('Empty'); + if (newSpec && !anyEmpty){ + // console.log('all seats taken, initMySeat.newSpec, mySeat=3'); mySeat = 3; }; this.setState({ -- libgit2 1.8.1