diff --git a/src/components/ChatView.vue b/src/components/ChatView.vue index 61140929946..d8d201241a5 100644 --- a/src/components/ChatView.vue +++ b/src/components/ChatView.vue @@ -86,6 +86,7 @@ import TransitionWrapper from './TransitionWrapper.vue' import { CONVERSATION } from '../constants.js' import { EventBus } from '../services/EventBus.js' +import { useChatExtrasStore } from '../stores/chatExtras.js' export default { @@ -108,6 +109,12 @@ export default { }, }, + setup() { + return { + chatExtrasStore: useChatExtrasStore(), + } + }, + data() { return { isChatScrolledToBottom: true, @@ -126,6 +133,10 @@ export default { return !userName && this.isGuest }, + isEditingMessage() { + return this.chatExtrasStore.getMessageIdToEdit(this.token) !== undefined + }, + dropHintText() { if (this.isGuest) { return t('spreed', 'You need to be logged in to upload files') @@ -155,7 +166,7 @@ export default { watch: { container(value) { this.containerId = value - } + }, }, mounted() { @@ -166,7 +177,7 @@ export default { methods: { handleDragOver(event) { - if (event.dataTransfer.types.includes('Files')) { + if (event.dataTransfer.types.includes('Files') && !this.isEditingMessage) { this.isDraggingOver = true } }, diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index 98a649ab6bf..96d5586729b 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -178,6 +178,7 @@ the main body of the message as well as a quote. :sent-icon-tooltip="sentIconTooltip" @show-translate-dialog="isTranslateDialogOpen = true" @reply="handleReply" + @edit="handleEdit" @delete="handleDelete" />
+