diff --git a/website/client/components/groups/chat.vue b/website/client/components/groups/chat.vue index 60418461d9..1f867c5461 100644 --- a/website/client/components/groups/chat.vue +++ b/website/client/components/groups/chat.vue @@ -66,6 +66,7 @@ data () { return { newMessage: '', + sending: false, chat: { submitDisable: false, submitTimeout: null, @@ -130,10 +131,10 @@ }); this.group.chat.unshift(response.message); this.newMessage = ''; - this.$refs['user-entry'].innerText = ''; this.sending = false; this.$refs['user-entry'].innerText = ''; + // @TODO: I would like to not reload everytime we send. Why are we reloading? // The response has all the necessary data... let chat = await this.$store.dispatch('chat:getChat', {groupId: this.group._id}); diff --git a/website/server/controllers/api-v3/chat.js b/website/server/controllers/api-v3/chat.js index 836d73accb..a72d1e1058 100644 --- a/website/server/controllers/api-v3/chat.js +++ b/website/server/controllers/api-v3/chat.js @@ -181,6 +181,7 @@ api.postChat = { if (client) { client = client.replace('habitica-', ''); } + const newChatMessage = group.sendChat(message, user, null, client); let toSave = [newChatMessage.save()];