X-Git-Url: https://git.auder.net/pieces/Checkered/cn.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=146beb01e98e84ea53775fb67d2190983cd5bb99;hb=b70a32d4e9a6446164e06ba07a586bb157aaf928;hp=50da38107ddae35c6f72c48d7b88882999f2a75e;hpb=1c15969ecec2a86ee7dffe570e53dfd61fd06b22;p=vchess.git
diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue
index 50da3810..146beb01 100644
--- a/client/src/views/Hall.vue
+++ b/client/src/views/Hall.vue
@@ -113,7 +113,7 @@ main
v-for="sid in Object.keys(people)"
v-if="!!people[sid].name"
)
- span {{ people[sid].name }}
+ UserBio.user-bio(:uid="people[sid].id" :uname="people[sid].name")
button.player-action(
v-if="isGamer(sid)"
@click="watchGame(sid)"
@@ -166,7 +166,7 @@ main
button.tabbtn#btnClive(@click="setDisplay('c','live',$event)")
| {{ st.tr["Live challenges"] }}
button.tabbtn#btnCcorr(@click="setDisplay('c','corr',$event)")
- | {{ st.tr["Correspondance challenges"] }}
+ | {{ st.tr["Correspondence challenges"] }}
ChallengeList(
v-show="cdisplay=='live'"
:challenges="filterChallenges('live')"
@@ -182,7 +182,7 @@ main
button.tabbtn#btnGlive(@click="setDisplay('g','live',$event)")
| {{ st.tr["Live games"] }}
button.tabbtn#btnGcorr(@click="setDisplay('g','corr',$event)")
- | {{ st.tr["Correspondance games"] }}
+ | {{ st.tr["Correspondence games"] }}
GameList(
v-show="gdisplay=='live'"
:games="filterGames('live')"
@@ -212,6 +212,7 @@ import params from "@/parameters";
import { getRandString, shuffle, randInt } from "@/utils/alea";
import { getDiagram } from "@/utils/printDiagram";
import Chat from "@/components/Chat.vue";
+import UserBio from "@/components/UserBio.vue";
import GameList from "@/components/GameList.vue";
import ChallengeList from "@/components/ChallengeList.vue";
import { GameStorage } from "@/utils/gameStorage";
@@ -220,6 +221,7 @@ export default {
name: "my-hall",
components: {
Chat,
+ UserBio,
GameList,
ChallengeList
},
@@ -859,7 +861,7 @@ export default {
this.startNewGame(gameInfo);
else {
this.infoMessage =
- this.st.tr["New correspondance game:"] + " " +
+ this.st.tr["New correspondence game:"] + " " +
"" +
"#/game/" + gameInfo.id + "";
document.getElementById("modalInfo").checked = true;
@@ -995,7 +997,7 @@ export default {
if (!this.newchallenge.vid)
error = this.st.tr["Please select a variant"];
else if (ctype == "corr" && this.st.user.id <= 0)
- error = this.st.tr["Please log in to play correspondance games"];
+ error = this.st.tr["Please log in to play correspondence games"];
else if (!!this.newchallenge.to) {
if (this.newchallenge.to == this.st.user.name)
error = this.st.tr["Self-challenge is forbidden"];
@@ -1103,7 +1105,7 @@ export default {
// Live challenges have a random ID
finishAddChallenge(null);
} else {
- // Correspondance game: send challenge to server
+ // Correspondence game: send challenge to server
ajax(
"/challenges",
"POST",
@@ -1288,23 +1290,22 @@ export default {
() => {
const myIdx = (game.players[0].sid == this.st.user.sid ? 0 : 1);
GameStorage.add(game, (err) => {
- // If an error occurred, game is not added: a tab already
- // added the game. Maybe a focused one, maybe not.
- // We know for sure that it emitted the gong start sound.
- // ==> Do not play it again.
- if (!err && this.st.settings.sound)
- new Audio("/sounds/newgame.flac").play().catch(() => {});
+ // If an error occurred, game is not added: the focused tab
+ // already added the game.
if (!this.focus) {
+ if (this.st.settings.sound)
+ // This will be played several times if several hidden tabs
+ // on Hall... TODO: fix that (how ?!)
+ new Audio("/sounds/newgame.flac").play().catch(() => {});
notify(
"New live game",
{ body: "vs " + game.players[1-myIdx].name || "@nonymous" }
);
}
- this.$router.push(
- "/game/" + gameInfo.id + "/?focus=" + this.focus);
+ this.$router.push("/game/" + gameInfo.id);
});
},
- this.focus ? 500 + 1000 * Math.random() : 0
+ this.focus ? 0 : 500 + 1000 * Math.random()
);
}
}
@@ -1313,7 +1314,7 @@ export default {