refactor: move fetching logic to onScrollToMessage

This commit is contained in:
Shivam Mishra
2023-11-30 13:08:49 +05:30
parent 9cc6275c82
commit baf1323ebd
2 changed files with 9 additions and 10 deletions
@@ -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',
});
});
},