fix: message URL navigation won't work

This commit is contained in:
Shivam Mishra
2023-11-30 20:46:37 +05:30
parent 8a7a5ca8d7
commit 97301c3080
2 changed files with 13 additions and 12 deletions
@@ -163,14 +163,14 @@ export default {
return;
}
const { messageId } = this.$route.query;
if (messageId) {
// this will automatically set the active chat
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId });
} else {
this.$store.dispatch('setActiveChat', {
this.$store
.dispatch('setActiveChat', {
data: selectedConversation,
after: messageId,
})
.then(() => {
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId });
});
}
} else {
this.$store.dispatch('clearSelectedState');
}