X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=a98b4c05e3629e55a5cb12b51e6dcb8c1820c1b3;hb=80b38d463c0d5dacac93bc2aeb666bbb19781e1e;hp=b3172aca7849870edf8d3e4ef2c0a324408d317d;hpb=659a9bd22c88177e203207a406cdb6c9f69139d4;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index b3172aca..a98b4c05 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)" @@ -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 }, @@ -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() ); } } @@ -1367,7 +1368,7 @@ button.player-action margin-left: 32px .somethingnew - background-color: #D6EAF8 !important + background-color: #90C4EC !important .tabbtn background-color: #f9faee @@ -1401,6 +1402,9 @@ button.refuseBtn #div2, #div3 margin-top: 0 +.user-bio + display: inline + tr > td &.random-0 background-color: #FF5733