diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index 69501e13a..806d45b2a 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -521,17 +521,9 @@ export default { }, HIGHLIGHT_TIMER); }, async navigateToMessage() { - // TODO: check if the message is already loaded - await this.$store.dispatch('setActiveChat', { - data: this.currentChat, - after: this.inReplyToMessageId, - force: true, - }); - this.$nextTick(() => { bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId: this.inReplyToMessageId, - behavior: 'instant', }); }); }, diff --git a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue index 7cff2d287..5288a648c 100644 --- a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue @@ -377,12 +377,19 @@ export default { removeBusListeners() { bus.$off(BUS_EVENTS.SCROLL_TO_MESSAGE, this.onScrollToMessage); }, - onScrollToMessage({ messageId = '', behavior = 'smooth' } = {}) { + async onScrollToMessage({ messageId }) { + // TODO: check if the message is already loaded + await this.$store.dispatch('setActiveChat', { + data: this.currentChat, + after: messageId, + force: true, + }); + this.$nextTick(() => { const messageElement = document.getElementById('message' + messageId); if (messageElement) { this.isProgrammaticScroll = true; - messageElement.scrollIntoView({ behavior }); + messageElement.scrollIntoView(); this.fetchPreviousMessages(); } else { this.scrollToBottom();