mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
fix: Cannot delete message with attachments without content (#6378)
This commit is contained in:
@@ -105,7 +105,8 @@
|
||||
v-if="isBubble && !isMessageDeleted"
|
||||
:is-open="showContextMenu"
|
||||
:show-copy="hasText"
|
||||
:show-canned-response-option="isOutgoing"
|
||||
:show-delete="hasTextOrAttachment"
|
||||
:show-canned-response-option="isOutgoing && hasText"
|
||||
:menu-position="contextMenuPosition"
|
||||
:message-content="data.content"
|
||||
@toggle="handleContextMenuClick"
|
||||
@@ -308,6 +309,9 @@ export default {
|
||||
hasText() {
|
||||
return !!this.data.content;
|
||||
},
|
||||
hasTextOrAttachment() {
|
||||
return this.hasText || this.data.attachments.length > 0;
|
||||
},
|
||||
tooltipForSender() {
|
||||
const name = this.senderNameForAvatar;
|
||||
const { message_type: messageType } = this.data;
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
:class="`dropdown-pane--${menuPosition}`"
|
||||
>
|
||||
<woot-dropdown-menu>
|
||||
<woot-dropdown-item v-if="showDelete">
|
||||
<woot-button
|
||||
variant="clear"
|
||||
color-scheme="alert"
|
||||
size="small"
|
||||
icon="delete"
|
||||
@click="handleDelete"
|
||||
>
|
||||
{{ $t('CONVERSATION.CONTEXT_MENU.DELETE') }}
|
||||
</woot-button>
|
||||
</woot-dropdown-item>
|
||||
<woot-dropdown-item v-if="showCopy">
|
||||
<woot-dropdown-item>
|
||||
<woot-button
|
||||
variant="clear"
|
||||
color-scheme="alert"
|
||||
size="small"
|
||||
icon="delete"
|
||||
@click="handleDelete"
|
||||
>
|
||||
{{ $t('CONVERSATION.CONTEXT_MENU.DELETE') }}
|
||||
</woot-button>
|
||||
</woot-dropdown-item>
|
||||
<woot-button
|
||||
variant="clear"
|
||||
size="small"
|
||||
@@ -46,10 +46,8 @@
|
||||
{{ $t('CONVERSATION.CONTEXT_MENU.COPY') }}
|
||||
</woot-button>
|
||||
</woot-dropdown-item>
|
||||
|
||||
<woot-dropdown-item>
|
||||
<woot-dropdown-item v-if="showCannedResponseOption">
|
||||
<woot-button
|
||||
v-if="showCannedResponseOption"
|
||||
variant="clear"
|
||||
size="small"
|
||||
icon="comment-add"
|
||||
@@ -94,6 +92,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
showDelete: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
menuPosition: {
|
||||
type: String,
|
||||
default: 'left',
|
||||
|
||||
Reference in New Issue
Block a user