diff options
Diffstat (limited to 'diplomacy/web')
-rw-r--r-- | diplomacy/web/src/gui/pages/content_game.jsx | 14 |
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); } |