Skip to content

Commit

Permalink
feat: Add an option to scroll to replied message (#8624)
Browse files Browse the repository at this point in the history
Co-authored-by: Pranav <pranav@chatwoot.com>
  • Loading branch information
clairton and pranavrajs committed May 2, 2024
1 parent cd14788 commit f57013c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
'bg-woot-600 text-woot-50': messageType === MESSAGE_TYPE.OUTGOING,
'-mx-2': !parentHasAttachments,
}"
@click="scrollToMessage"
>
<message-preview
class="cursor-pointer"
:message="message"
:show-message-type="false"
:default-empty-message="$t('CONVERSATION.REPLY_MESSAGE_NOT_FOUND')"
Expand All @@ -19,6 +21,7 @@
<script>
import MessagePreview from 'dashboard/components/widgets/conversation/MessagePreview.vue';
import { MESSAGE_TYPE } from 'shared/constants/messages';
import { BUS_EVENTS } from 'shared/constants/busEvents';
export default {
name: 'ReplyTo',
Expand All @@ -42,5 +45,10 @@ export default {
data() {
return { MESSAGE_TYPE };
},
methods: {
scrollToMessage() {
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId: this.message.id });
},
},
};
</script>

0 comments on commit f57013c

Please sign in to comment.