X-Git-Url: https://git.auder.net/game/current/git-logo.png?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=0ed355bf5cdae241da3c81b1d397c6c2081a6a14;hb=bfa7d9931b50c1ed54ff3c6d4ef5bc423f26de94;hp=57557d493e2f0c69a26ab5ad8d2536fba01d99f1;hpb=2c5d7b20742b802d9c47916915c1114bcfc9a9c3;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 57557d49..0ed355bf 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -502,7 +502,7 @@ export default { document.getElementById("cadence").focus(); }, send: function(code, obj) { - if (!!this.conn) { + if (!!this.conn && this.conn.readyState == 1) { this.conn.send(JSON.stringify(Object.assign({ code: code }, obj))); } }, @@ -927,6 +927,15 @@ export default { .getElementById("btnC" + newChall.type) .classList.add("somethingnew"); } + if (!!chall.to) { + 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...") } + ); + } } }, loadNewchallVariant: async function(cb) {