From afbb98eb4d0e21fe50c65f8fdc56bfd0ecec50a9 Mon Sep 17 00:00:00 2001 From: adb Date: Fri, 19 Mar 2021 00:15:22 +0100 Subject: [PATCH] fix newMessage --- src/components/newMessage.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/newMessage.vue b/src/components/newMessage.vue index 4bee8ac..3048a05 100644 --- a/src/components/newMessage.vue +++ b/src/components/newMessage.vue @@ -36,14 +36,15 @@ export default { }, methods: { async sendMessage(){ - if (this.msg.content.body !== "") { - let msgSend = Object.assign({}, this.msg); - this.msg.content.body = ""; - await matrix.sendEvent(msgSend, this.roomId); - let id = this.$refs.newMessageInput; - id.style.height = "1.25rem"; - this.onResize(id.parentElement.clientHeight); - } + let content = this.msg.content; + if (!content.body) return; + //content.body = content.body.replace(/\n$/gm, ''); + let msgSend = Object.assign({}, this.msg); + await matrix.sendEvent(msgSend, this.roomId); + content.body = ""; + let id = this.$refs.newMessageInput; + id.style.height = "1.25rem"; + this.onResize(id.parentElement.clientHeight); }, resizeMessageBanner(){ let id = this.$refs.newMessageInput;