From 8728db8869b85e6a98795a45612f622349d92ec5 Mon Sep 17 00:00:00 2001 From: Gabriel Jablonski Date: Thu, 26 Mar 2026 12:46:53 -0300 Subject: [PATCH] fix(conversation): restore scroll-to-bottom after switching conversations (#250) The scheduled-messages refactor (9a05ff524) split setActiveChat into two branches but dropped the .then() callback that emits SCROLL_TO_MESSAGE for normal conversation loads (no messageId). Without this event scrollToBottom() never fires after messages load, leaving the scroll at the top and triggering infinite history fetch. --- .../routes/dashboard/conversation/ConversationView.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue b/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue index 8140a9453..59b18aa14 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue @@ -194,9 +194,13 @@ export default { emitter.emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId }); }); } else { - this.$store.dispatch('setActiveChat', { - data: selectedConversation, - }); + this.$store + .dispatch('setActiveChat', { + data: selectedConversation, + }) + .then(() => { + emitter.emit(BUS_EVENTS.SCROLL_TO_MESSAGE); + }); } } else { this.$store.dispatch('clearSelectedState');