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.
This commit is contained in:
Gabriel Jablonski 2026-03-26 12:46:53 -03:00 committed by GitHub
parent 3aba6affd4
commit 8728db8869
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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');