fix: setting active chat when messageId is missing

This commit is contained in:
Shivam Mishra
2023-11-30 13:45:43 +05:30
parent 29292fd99d
commit 04160c04cc
@@ -1,5 +1,5 @@
<template>
<section class="conversation-page bg-white dark:bg-slate-900">
<section class="bg-white conversation-page dark:bg-slate-900">
<chat-list
:show-conversation-list="showConversationList"
:conversation-inbox="inboxId"
@@ -163,7 +163,14 @@ export default {
return;
}
const { messageId } = this.$route.query;
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId });
if (messageId) {
// this will automatically set the active chat
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { messageId });
} else {
this.$store.dispatch('setActiveChat', {
data: selectedConversation,
});
}
} else {
this.$store.dispatch('clearSelectedState');
}