X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FChat.vue;h=510acddae13f46b49cc45af335d7f44bd463d001;hp=6eb7ef31bcb7442b3326d89fd63125ec9aa46c4b;hb=8be8238cbd8bd1eeeb4c101648d6902cae425f7b;hpb=c583ef1c1dfd19aee88b22c2175202fbdf4dc1c0 diff --git a/client/src/components/Chat.vue b/client/src/components/Chat.vue index 6eb7ef31..510acdda 100644 --- a/client/src/components/Chat.vue +++ b/client/src/components/Chat.vue @@ -21,19 +21,13 @@ import { store } from "@/store"; export default { name: "my-chat", // Prop 'pastChats' for corr games where chats are on server - props: ["players", "pastChats", "newChat"], + props: ["players", "pastChats"], data: function() { return { st: store.state, chats: [] //chat messages after human game }; }, - watch: { - newChat: function(chat) { - if (chat.msg != "") - this.chats.unshift({ msg: chat.msg, name: chat.name || "@nonymous" }); - } - }, methods: { classObject: function(chat) { return { @@ -54,6 +48,10 @@ export default { this.$emit("mychat", chat); this.chats.unshift(chat); }, + newChat: function(chat) { + if (chat.msg != "") + this.chats.unshift({ msg: chat.msg, name: chat.name || "@nonymous" }); + }, clearHistory: function() { this.chats = []; this.$emit("chatcleared");