Commit 4d3c1d2a authored by Yannick Li's avatar Yannick Li
Browse files

Pass handler when opening crdt

parent dcad7819
......@@ -67,9 +67,7 @@ class Game extends React.Component<Record<string, unknown>, IGameState> {
"grid" + gridNum,
"MVMap",
false,
function () {
return;
}
this.handler.bind(this)
);
this.state = {
gridNum: gridNum,
......@@ -106,6 +104,13 @@ class Game extends React.Component<Record<string, unknown>, IGameState> {
clearInterval(this.timerID);
}
/**
* Handles update
*/
private handler() {
this.pullGrid();
}
/**
* Update cells values from C-Client.
*/
......@@ -231,9 +236,7 @@ class Game extends React.Component<Record<string, unknown>, IGameState> {
"grid" + gridNum,
"MVMap",
false,
function () {
return;
}
this.handler.bind(this)
);
this.setState({ gridNum: gridNum, mvmap: mvmap });
this.initFrom(generateStaticGrid(gridNum));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment