X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=bbff9b951f14625ad8930facb44bb7134e739d94;hb=29ced362f46ae68e4314985bf836b3adeba23f32;hp=0ce00e70105483e261227eb50c8787aa86e40518;hpb=fe4c7e67075416c48aafe9e307bef5afea7937bc;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 0ce00e70..bbff9b95 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -18,7 +18,7 @@ main :selected="newchallenge.vid==v.id") | {{ v.name }} fieldset - label(for="timeControl") {{ st.tr["Time control"] }} * + label(for="timeControl") {{ st.tr["Cadence"] }} * div#predefinedTimeControls button 3+2 button 5+3 @@ -509,17 +509,18 @@ export default { this.newchallenge.to = this.people[sid].name; doClick("modalNewgame"); }, - challOrWatch: function(sid, e) { - switch (e.target.innerHTML) + challOrWatch: function(sid) { + if (!this.people[sid].gamer) { - case "Available": - this.tryChallenge(sid); - break; - case "Playing": - this.showGame(this.games.find( - g => g.players.some(pl => pl.sid == sid || pl.uid == this.people[sid].id))); - break; - }; + // Available, in Hall + this.tryChallenge(sid); + } + else + { + // Playing, in Game + this.showGame(this.games.find( + g => g.players.some(pl => pl.sid == sid || pl.uid == this.people[sid].id))); + } }, newChallenge: async function() { if (this.newchallenge.vid == "")