Cosmetics: display variant name when sending challenge through URL
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 16 Mar 2021 12:27:37 +0000 (13:27 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 16 Mar 2021 12:27:37 +0000 (13:27 +0100)
client/src/views/Hall.vue

index 39b9027..22ffe45 100644 (file)
@@ -315,19 +315,22 @@ export default {
         // Automatic challenge sending, for tournaments
         this.loadNewchallVariant(
           () => {
         // 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.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.
           },
             window.doClick("modalNewgame");
             //this.issueNewChallenge(); //NOTE: doesn't work yet.
           },