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:
parent
e70874cbcf
commit
526911bc0e
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue