X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FMyGames.vue;h=a9e69f653ad93814d30f25240e89fc15ce59cabe;hb=68e19a449db7a12e0a168e99cd750d985c983ba1;hp=628d72ebbcbb1ac6c5a3f914a3b68b545785c940;hpb=0234201fb338fc239d6f613c677fa932c7c3697c;p=vchess.git diff --git a/client/src/views/MyGames.vue b/client/src/views/MyGames.vue index 628d72eb..a9e69f65 100644 --- a/client/src/views/MyGames.vue +++ b/client/src/views/MyGames.vue @@ -103,20 +103,25 @@ export default { "/runninggames", "GET", { + credentials: true, success: (res) => { // These games are garanteed to not be deleted this.corrGames = res.games; - this.corrGames.forEach(g => g.type = "corr"); + this.corrGames.forEach(g => { + g.type = "corr"; + g.score = "*"; + }); this.decorate(this.corrGames); // Now ask completed games (partial list) ajax( "/completedgames", "GET", { + credentials: true, data: { cursor: this.cursor }, success: (res2) => { - if (res2.games.length > 0) { - const L = res2.games.length; + const L = res2.games.length; + if (L > 0) { this.cursor = res2.games[L - 1].created; let completedGames = res2.games; completedGames.forEach(g => g.type = "corr"); @@ -191,7 +196,7 @@ export default { if (thing == "turn") { game.myTurn = !game.myTurn; if (game.myTurn) this.tryShowNewsIndicator(type); - } + } else game.myTurn = false; // TODO: forcing refresh like that is ugly and wrong. // How to do it cleanly? this.$refs[type + "games"].$forceUpdate(); @@ -287,10 +292,11 @@ export default { "/completedgames", "GET", { + credentials: true, data: { cursor: this.cursor }, success: (res) => { - if (res.games.length > 0) { - const L = res.games.length; + const L = res.games.length; + if (L > 0) { this.cursor = res.games[L - 1].created; let moreGames = res.games; moreGames.forEach(g => g.type = "corr"); @@ -316,8 +322,8 @@ table.game-list max-height: 100% button#loadMoreBtn - margin-top: 0 - margin-bottom: 0 + display: block + margin: 0 auto .somethingnew background-color: #c5fefe !important