diff --git a/src/routes/game/[did]/[rkey]/+page.svelte b/src/routes/game/[did]/[rkey]/+page.svelte index d3b406d..7a53861 100644 --- a/src/routes/game/[did]/[rkey]/+page.svelte +++ b/src/routes/game/[did]/[rkey]/+page.svelte @@ -340,6 +340,7 @@ const pgn = record.pgn as string; if (pgn && game.applyOpponentMove(pgn)) { + lastPersistedPgn = pgn; sound.play('notify'); } @@ -574,10 +575,12 @@ rematchCreating = true; try { const opponentDid = game.myColor === 'white' ? game.blackDid : game.whiteDid; + const newWhite = game.myColor === 'white' ? opponentDid : auth.did; + const newBlack = game.myColor === 'white' ? auth.did : opponentDid; const isVariant = game.startingFen != null; const result = await createGame(auth.agent, { - white: opponentDid, - black: auth.did, + white: newWhite, + black: newBlack, status: 'waiting', variant: isVariant ? 'really-bad-chess' : undefined, pgn: isVariant ? makeInitialPgn(generateRandomFen(), 'Really Bad Chess') : undefined,