File tree Expand file tree Collapse file tree
src/web/react/components/othello Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import type { SerializedInstance } from '@/types/common';
99
1010export type GameModelAPI = SerializedInstance < Omit < GameModel , 'winCtx' > & { winCtx : Othello [ 'winCtx' ] } > ;
1111
12- type OthelloLog = { action : 'play' | 'skip' ; time : string ; turn : 'W' | 'B' ; ctx : [ number , number ] } ;
12+ type OthelloLog = { action : 'play' | 'skip' ; time : string ; turn : 'W' | 'B' ; ctx : [ number , number ] | null } ;
1313
1414type Board = ( null | 'W' | 'B' ) [ ] [ ] ;
1515type GameState = { board : Board ; sinceLast : number | null ; at : Date ; score : { W : number ; B : number } } ;
@@ -150,7 +150,7 @@ export const ViewOnlyOthello = memo(({ game }: { game: GameModelAPI }): ReactEle
150150 ( boards , entry ) => {
151151 const lastState = boards . at ( - 1 ) ! ;
152152 const nextBoard = cloneBoard ( lastState . board ) ;
153- playOnBoard ( nextBoard , entry . turn , ...entry . ctx ) ;
153+ if ( entry . action === 'play' ) playOnBoard ( nextBoard , entry . turn , ...entry . ctx ! ) ;
154154 const playedAt = new Date ( entry . time ) ;
155155 const nextState : GameState = {
156156 board : nextBoard ,
You can’t perform that action at this time.
0 commit comments