fix timeouts
This commit is contained in:
@@ -13,13 +13,16 @@ const addState = connect(
|
||||
|
||||
if (!game) {
|
||||
ws.clearGameStateTimeout();
|
||||
} else {
|
||||
ws.startGameStateTimeout(game.id);
|
||||
}
|
||||
|
||||
if (!instance) {
|
||||
ws.clearInstanceStateTimeout();
|
||||
} else {
|
||||
ws.startInstanceStateTimeout(instance.id);
|
||||
}
|
||||
|
||||
|
||||
return { game, instance, account };
|
||||
}
|
||||
);
|
||||
|
||||
@@ -50,15 +50,14 @@ function GamePanel(props) {
|
||||
}
|
||||
|
||||
function backClick() {
|
||||
quit();
|
||||
return sendInstanceState(game.instance);
|
||||
if (game.phase === 'Finish') sendInstanceState(game.instance);
|
||||
return quit();
|
||||
}
|
||||
|
||||
const header = (
|
||||
<div className="instance-hdr">
|
||||
<button
|
||||
className="game-back-btn instance-btn instance-ui-btn left"
|
||||
disabled={game.phase !== 'Finish'}
|
||||
onClick={backClick}>
|
||||
Back
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user