Don't update the game list when it isn't visible (i.e. you're already in a game). The client will refresh it when the player leaves their game anyway. This will hopefully cut down on a lot of bandwidth usage -- that's a lot of data sent around whenever anybody joins or leaves any game, and nobody sees it.

This commit is contained in:
Andy Janata 2013-03-02 23:50:24 -08:00
parent e70874cbcf
commit 526911bc0e
1 changed files with 4 additions and 2 deletions

View File

@ -80,8 +80,10 @@ cah.GameList.prototype.hide = function() {
* Query the server to update the game list.
*/
cah.GameList.prototype.update = function() {
if ($(this.element_).is(":visible")) {
// TODO display a loading indicator of some sort
cah.Ajax.build(cah.$.AjaxOperation.GAME_LIST).run();
}
};
/**