From 92881686dc500d26eac8792456a32a1dcaf4cb2b Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 6 Oct 2023 02:44:54 +0100 Subject: [PATCH 1/6] feat: preserve message text in the input field --- src/components/AChat/AChatForm.vue | 8 +++++++- src/components/Chat/Chat.vue | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/AChat/AChatForm.vue b/src/components/AChat/AChatForm.vue index 90f165236..880b1f0a6 100644 --- a/src/components/AChat/AChatForm.vue +++ b/src/components/AChat/AChatForm.vue @@ -54,6 +54,10 @@ export default { showDivider: { type: Boolean, default: false + }, + clearInputValueOnSend: { + type: Boolean, + default: true } }, emits: ['message', 'esc'], @@ -119,7 +123,9 @@ export default { methods: { submitMessage() { this.$emit('message', this.message) - this.message = '' + if (this.clearInputValueOnSend === true) { + this.message = '' + } // Fix textarea height to 1 row after miltiline message send this.calculateInputHeight() this.focus() diff --git a/src/components/Chat/Chat.vue b/src/components/Chat/Chat.vue index 9d5c97bc3..f96d2654f 100644 --- a/src/components/Chat/Chat.vue +++ b/src/components/Chat/Chat.vue @@ -209,6 +209,7 @@ :message-text="$route.query.messageText" @message="onMessage" @esc="replyMessageId = -1" + :clearInputValueOnSend="this.$store.state.balance < 0.001 === false" >