It's not resetting _all_ state, just the board.
In the past, these two notions were basically the same, (since the
board was the only state we hadd), but soon we'll be adding players
and other information outside the board, so this new naming is more
clear.
events.addEventListener("game-state", event => {
const state = JSON.parse(event.data);
events.addEventListener("game-state", event => {
const state = JSON.parse(event.data);
- window.game.reset_state();
+ window.game.reset_board();
for (let square of state.moves) {
window.game.receive_move(square);
for (let square of state.moves) {
window.game.receive_move(square);
return fetch_post_json("move", { move: i });
}
return fetch_post_json("move", { move: i });
}
this.setState({
history: [
{
this.setState({
history: [
{