X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=bbff9b951f14625ad8930facb44bb7134e739d94;hp=fbd5e28690703afb947106e6e17aaad81c5cc64d;hb=29ced362f46ae68e4314985bf836b3adeba23f32;hpb=bc9b5f227f930a54cd98729fce3d800d0c9409ed diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index fbd5e286..bbff9b95 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -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 == "")