feat: allow showing in-reply-to message
This commit is contained in:
@@ -34,6 +34,11 @@
|
||||
:url="storyUrl"
|
||||
/>
|
||||
</blockquote>
|
||||
<bubble-reply-to
|
||||
v-if="inReplyTo"
|
||||
:content="inReplyTo.content"
|
||||
@click="navigateToMessage"
|
||||
/>
|
||||
<bubble-text
|
||||
v-if="data.content"
|
||||
:message="message"
|
||||
@@ -141,6 +146,7 @@ import BubbleLocation from './bubble/Location.vue';
|
||||
import BubbleMailHead from './bubble/MailHead.vue';
|
||||
import BubbleText from './bubble/Text.vue';
|
||||
import BubbleContact from './bubble/Contact.vue';
|
||||
import BubbleReplyTo from './bubble/ReplyTo.vue';
|
||||
import Spinner from 'shared/components/Spinner.vue';
|
||||
import ContextMenu from 'dashboard/modules/conversations/components/MessageContextMenu.vue';
|
||||
import instagramImageErrorPlaceholder from './instagramImageErrorPlaceholder.vue';
|
||||
@@ -165,6 +171,7 @@ export default {
|
||||
BubbleMailHead,
|
||||
BubbleText,
|
||||
BubbleContact,
|
||||
BubbleReplyTo,
|
||||
ContextMenu,
|
||||
Spinner,
|
||||
instagramImageErrorPlaceholder,
|
||||
@@ -175,6 +182,10 @@ export default {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
currentChat: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
isATweet: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -271,6 +282,18 @@ export default {
|
||||
) + botMessageContent
|
||||
);
|
||||
},
|
||||
inReplyTo() {
|
||||
const replyToMessageId = this.data.content_attributes?.in_reply_to;
|
||||
|
||||
if (!replyToMessageId) return null;
|
||||
|
||||
return this.currentChat?.messages.find(message => {
|
||||
if (message.id === replyToMessageId) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
},
|
||||
contextMenuEnabledOptions() {
|
||||
return {
|
||||
copy: this.hasText,
|
||||
@@ -522,6 +545,13 @@ export default {
|
||||
this.showBackgroundHighlight = false;
|
||||
}, HIGHLIGHT_TIMER);
|
||||
},
|
||||
navigateToMessage() {
|
||||
this.$nextTick(() => {
|
||||
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, {
|
||||
messageId: this.inReplyTo?.id,
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user