From 3837d4f7885a3c3cdb468da2f3fa3fa1e5a1415a Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Fri, 31 Jan 2020 01:25:03 +0100 Subject: [PATCH] Fixes --- client/src/App.vue | 2 +- client/src/components/BaseGame.vue | 2 +- client/src/components/Chat.vue | 6 ++- client/src/components/MoveList.vue | 2 + client/src/components/UpsertUser.vue | 2 +- client/src/views/Game.vue | 5 ++- server/db/create.sql | 3 +- server/models/Game.js | 67 ++++++++++++++++++++-------- server/sockets.js | 4 +- 9 files changed, 66 insertions(+), 27 deletions(-) diff --git a/client/src/App.vue b/client/src/App.vue index 77fed7af..6c945663 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -26,7 +26,7 @@ | {{ st.tr["Forum"] }} #rightMenu .clickable(onClick="doClick('modalUser')") - | {{ st.user.id > 0 ? "Update" : "Login" }} + | {{ st.user.id > 0 ? (st.user.name || "@nonymous") : "Login" }} .clickable(onClick="doClick('modalSettings')") | {{ st.tr["Settings"] }} .clickable#flagContainer(onClick="doClick('modalLang')") diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 1ea862fb..608a98d4 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -255,7 +255,7 @@ export default { else this.moves = this.moves.slice(0,this.cursor).concat([move]); } - if (this.game.mode != "analyze") + if (!navigate && this.game.mode != "analyze") this.$emit("newmove", move); //post-processing (e.g. computer play) // Is opponent in check? this.incheck = this.vr.getCheckSquares(this.vr.turn); diff --git a/client/src/components/Chat.vue b/client/src/components/Chat.vue index cd3c3c89..8f1646f4 100644 --- a/client/src/components/Chat.vue +++ b/client/src/components/Chat.vue @@ -3,7 +3,8 @@ input#inputChat(type="text" :placeholder="st.tr['Type here']" @keyup.enter="sendChat") button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }} - p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg") + p(v-for="chat in pastChats" :class="classObject(chat)" v-html="chat.name + ': ' + chat.msg") + p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.name + ': ' + chat.msg")