X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FMyGames.vue;h=5c3522ec55561487c0746a282aca0b8e3710b818;hb=e50a802531b99829c533f22ecd21e359e7e1e049;hp=10ec0c279fcd40e91823ab80c642bbe9e8e263ef;hpb=4b8cf8ef68475a9511b150547857912c6f7a958d;p=vchess.git diff --git a/client/src/views/MyGames.vue b/client/src/views/MyGames.vue index 10ec0c27..5c3522ec 100644 --- a/client/src/views/MyGames.vue +++ b/client/src/views/MyGames.vue @@ -6,7 +6,7 @@ main button.tabbtn#liveGames(@click="setDisplay('live',$event)") | {{ st.tr["Live games"] }} button.tabbtn#corrGames(@click="setDisplay('corr',$event)") - | {{ st.tr["Correspondance games"] }} + | {{ st.tr["Correspondence games"] }} button.tabbtn#importGames(@click="setDisplay('import',$event)") | {{ st.tr["Imported games"] }} GameList( @@ -31,6 +31,7 @@ main v-show="display=='import'" ref="importgames" :games="importGames" + :show-both="true" @show-game="showGame" ) button#loadMoreBtn( @@ -111,7 +112,7 @@ export default { }, mounted: function() { const adjustAndSetDisplay = () => { - // showType is the last type viwed by the user (default) + // showType is the last type viewed by the user (default) let showType = localStorage.getItem("type-myGames") || "live"; // Live games, my turn: highest priority: if (this.liveGames.some(g => !!g.myTurn)) showType = "live"; @@ -182,7 +183,7 @@ export default { setDisplay: function(type, e) { this.display = type; localStorage.setItem("type-myGames", type); - let elt = e ? e.target : document.getElementById(type + "Games"); + let elt = (!!e ? e.target : document.getElementById(type + "Games")); elt.classList.add("active"); elt.classList.remove("somethingnew"); //in case of for (let t of ["live","corr","import"]) { @@ -243,7 +244,7 @@ export default { case "notifyturn": case "notifyscore": { const info = data.data; - const type = (!!parseInt(info.gid) ? "corr" : "live"); + const type = (!!parseInt(info.gid, 10) ? "corr" : "live"); let game = gamesArrays[type].find(g => g.id == info.gid); // "notifything" --> "thing": const thing = data.code.substr(6); @@ -251,7 +252,8 @@ export default { if (thing == "turn") { game.myTurn = !game.myTurn; if (game.myTurn) this.tryShowNewsIndicator(type); - } else game.myTurn = false; + } + else game.myTurn = false; // TODO: forcing refresh like that is ugly and wrong. // How to do it cleanly? this.$refs[type + "games"].$forceUpdate(); @@ -356,7 +358,8 @@ export default { moreGames.forEach(g => g.type = "corr"); this.decorate(moreGames); this.corrGames = this.corrGames.concat(moreGames); - } else this.hasMore["corr"] = false; + } + else this.hasMore["corr"] = false; if (!!cb) cb(); } } @@ -371,7 +374,8 @@ export default { localGames.forEach(g => g.type = "live"); this.decorate(localGames); this.liveGames = this.liveGames.concat(localGames); - } else this.hasMore["live"] = false; + } + else this.hasMore["live"] = false; if (!!cb) cb(); }); } @@ -383,7 +387,8 @@ export default { this.cursor["import"] = importGames[L - 1].created - 1; importGames.forEach(g => g.type = "import"); this.importGames = this.importGames.concat(importGames); - } else this.hasMore["import"] = false; + } + else this.hasMore["import"] = false; if (!!cb) cb(); }); } @@ -394,7 +399,7 @@ export default {