Refresh Watch Battle when clicking Watch Battle

If Watch Battle is open, trying to open it again will refresh it
in addition to focusing it. Previously, it would only refresh if it's
been over 60 seconds since the previous refresh.
This commit is contained in:
Guangcong Luo
2016-03-07 16:06:45 -05:00
parent 07a339f62c
commit 88fbafb64b
2 changed files with 5 additions and 0 deletions

View File

@@ -157,6 +157,10 @@
this.$('button[name=refresh]').focus();
this.$el.scrollTop(prevPos);
},
rejoin: function () {
app.send('/cmd roomlist');
this.lastUpdate = new Date().getTime();
},
update: function (data) {
if (!data && !this.data) {
if (app.isDisconnected) {

View File

@@ -1169,6 +1169,7 @@
joinRoom: function (id, type, nojoin) {
if (this.rooms[id]) {
this.focusRoom(id);
if (this.rooms[id].rejoin) this.rooms[id].rejoin();
return this.rooms[id];
}
if (id.substr(0, 11) === 'battle-gen5' && !Tools.loadedSpriteData['bw']) Tools.loadSpriteData('bw');