fix: Disable sender tooltip and copy button in deleted messages (#2637)

This commit is contained in:
Muhsin Keloth 2021-07-15 21:06:54 +05:30 committed by GitHub
parent 72069e45ef
commit 85ea56b765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,7 @@
</div> </div>
<div class="context-menu-wrap"> <div class="context-menu-wrap">
<context-menu <context-menu
v-if="isBubble" v-if="isBubble && !isMessageDeleted"
:is-open="showContextMenu" :is-open="showContextMenu"
:show-copy="hasText" :show-copy="hasText"
:menu-position="contextMenuPosition" :menu-position="contextMenuPosition"
@ -196,6 +196,9 @@ export default {
hasAttachments() { hasAttachments() {
return !!(this.data.attachments && this.data.attachments.length > 0); return !!(this.data.attachments && this.data.attachments.length > 0);
}, },
isMessageDeleted() {
return this.contentAttributes.deleted;
},
hasImageAttachment() { hasImageAttachment() {
if (this.hasAttachments && this.data.attachments.length > 0) { if (this.hasAttachments && this.data.attachments.length > 0) {
const { attachments = [{}] } = this.data; const { attachments = [{}] } = this.data;
@ -208,6 +211,9 @@ export default {
return !!this.data.content; return !!this.data.content;
}, },
sentByMessage() { sentByMessage() {
if (this.isMessageDeleted) {
return false;
}
const { sender } = this; const { sender } = this;
return this.data.message_type === 1 && !isEmptyObject(sender) return this.data.message_type === 1 && !isEmptyObject(sender)
? { ? {