From 467725641f72d49aeaee449d66991d53adee5446 Mon Sep 17 00:00:00 2001 From: Gavin Lambert Date: Mon, 10 Jun 2013 22:48:03 +1200 Subject: [PATCH] Fix gamelist refresh on leaving game Game list update was skipped if the game list wasn't visible. Fix up a couple of cases when switching back to the game list the update was called in the wrong order. --- WebContent/js/cah.ajax.handlers.js | 3 ++- WebContent/js/cah.longpoll.handlers.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WebContent/js/cah.ajax.handlers.js b/WebContent/js/cah.ajax.handlers.js index 83e8163..48ecd53 100644 --- a/WebContent/js/cah.ajax.handlers.js +++ b/WebContent/js/cah.ajax.handlers.js @@ -137,8 +137,9 @@ cah.ajax.SuccessHandlers[cah.$.AjaxOperation.LEAVE_GAME] = function(data, req) { game.dispose(); delete cah.currentGames[req[cah.$.AjaxRequest.GAME_ID]]; } - cah.GameList.instance.update(); cah.GameList.instance.show(); + cah.GameList.instance.update(); + }; cah.ajax.SuccessHandlers[cah.$.AjaxOperation.START_GAME] = function(data, req) { diff --git a/WebContent/js/cah.longpoll.handlers.js b/WebContent/js/cah.longpoll.handlers.js index 6cfd1a0..eac8491 100644 --- a/WebContent/js/cah.longpoll.handlers.js +++ b/WebContent/js/cah.longpoll.handlers.js @@ -191,8 +191,8 @@ cah.longpoll.EventHandlers[cah.$.LongPollEvent.KICKED_FROM_GAME_IDLE] = function game.dispose(); delete cah.currentGames[data[cah.$.LongPollResponse.GAME_ID]]; } - cah.GameList.instance.update(); cah.GameList.instance.show(); + cah.GameList.instance.update(); cah.log.error("You were kicked from game " + data[cah.$.LongPollResponse.GAME_ID] + " for being idle for too long.");