aboutsummaryrefslogtreecommitdiff
path: root/diplomacy
diff options
context:
space:
mode:
authornotoraptor <notoraptor@users.noreply.github.com>2019-07-19 07:54:43 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-07-19 07:54:43 -0400
commit978b51fccb428c76b5d912ab748a313efa18676a (patch)
tree43a3baf3335ebcf66c84e3042efed7b40a4a2950 /diplomacy
parent33105a895a0b3c2b266c66058f5a8ec930c88504 (diff)
[web] Update state correctly when a power is kicked. (#54)
Diffstat (limited to 'diplomacy')
-rw-r--r--diplomacy/web/src/gui/pages/content_game.jsx14
1 files changed, 8 insertions, 6 deletions
diff --git a/diplomacy/web/src/gui/pages/content_game.jsx b/diplomacy/web/src/gui/pages/content_game.jsx
index 2941b6b..f37bdca 100644
--- a/diplomacy/web/src/gui/pages/content_game.jsx
+++ b/diplomacy/web/src/gui/pages/content_game.jsx
@@ -334,12 +334,14 @@ export class ContentGame extends React.Component {
|| !networkGame.channel.game_id_to_instances[networkGame.local.game_id].has(networkGame.local.role)
)) {
// This power game is now invalid.
- this.getPage().disconnectGame(networkGame.local.game_id);
- if (this.networkGameIsDisplayed(networkGame)) {
- const page = this.getPage();
- page.loadGames(
- {error: `${networkGame.local.game_id}/${networkGame.local.role} was kicked. Deadline over?`});
- }
+ this.getPage().disconnectGame(networkGame.local.game_id)
+ .then(() => {
+ if (this.networkGameIsDisplayed(networkGame)) {
+ const page = this.getPage();
+ page.loadGames(
+ {error: `${networkGame.local.game_id}/${networkGame.local.role} was kicked. Deadline over?`});
+ }
+ });
} else {
this.notifiedNetworkGame(networkGame, notification);
}