X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=c6b00d48117230a0902ef15786e2957a8dcbf6a1;hb=07d62cec868b1c1a04cf28679cc274417fdf2649;hp=ebb4675368f90060e17155bd96af56fcfde805ff;hpb=4a2093139089632727de4f510127ef186cab528e;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index ebb46753..c6b00d48 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -315,20 +315,24 @@ export default { // Automatic challenge sending, for tournaments this.loadNewchallVariant( () => { - this.newchallenge = { - fen: "", - vid: - this.st.variants - .find(v => v.name == this.$route.query["variant"]) - .id, - to: this.$route.query["challenge"], - color: this.$route.query["color"] || '', - cadence: this.$route.query["cadence"], - // Tournament: no randomness (TODO: for now at least) - randomness: 0, - memorize: false - }; - this.issueNewChallenge(); + this.newchallenge = Object.assign( + this.newchallenge, + { + fen: "", + vid: + this.st.variants + .find(v => v.name == this.$route.query["variant"]) + .id, + to: this.$route.query["challenge"], + color: this.$route.query["color"] || '', + cadence: this.$route.query["cadence"], + // Tournament: no randomness (TODO: for now at least) + randomness: 0, + memorize: false + } + ); + window.doClick("modalNewgame"); + //this.issueNewChallenge(); //NOTE: doesn't work yet. }, this.$route.query["variant"] ); @@ -982,13 +986,13 @@ export default { .getElementById("btnC" + newChall.type) .classList.add("somethingnew"); } - if (!!chall.to) { + if (!!chall.to && chall.to == this.st.user.name) { notify( "New challenge", // fromValues.name should exist since the player is online, but // let's consider there is some chance that the challenge arrives // right after we connected and before receiving the poll result: - { body: "from " + (fromValues.name || "unknown yet...") } + { body: "from " + (fromValues.name || "@nonymous") } ); } } @@ -1305,6 +1309,7 @@ export default { // on game just after, the main Hall will be notified. }; if (c.type == "live") { + // TODO: ask my IP + opp IP, to add to game infos? (potential bans) notifyNewgame(); this.startNewGame(gameInfo); // Increment game stats counter in DB