fix: Reset inbox on conversation switch in compose conversation modal (#12174)
This commit is contained in:
@@ -188,14 +188,18 @@ const toggle = () => {
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
activeContact,
|
activeContact,
|
||||||
() => {
|
(currentContact, previousContact) => {
|
||||||
if (activeContact.value && props.contactId) {
|
if (currentContact && props.contactId) {
|
||||||
const contactInboxes = activeContact.value?.contactInboxes || [];
|
// Reset on contact change
|
||||||
|
if (currentContact?.id !== previousContact?.id) clearSelectedContact();
|
||||||
|
|
||||||
// First process the contactable inboxes to get the right structure
|
// First process the contactable inboxes to get the right structure
|
||||||
const processedInboxes = processContactableInboxes(contactInboxes);
|
const processedInboxes = processContactableInboxes(
|
||||||
|
currentContact.contactInboxes || []
|
||||||
|
);
|
||||||
// Then Merge processedInboxes with the inboxes list
|
// Then Merge processedInboxes with the inboxes list
|
||||||
selectedContact.value = {
|
selectedContact.value = {
|
||||||
...activeContact.value,
|
...currentContact,
|
||||||
contactInboxes: mergeInboxDetails(processedInboxes, inboxesList.value),
|
contactInboxes: mergeInboxDetails(processedInboxes, inboxesList.value),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ const handleSendWhatsappMessage = async ({ message, templateParams }) => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="w-[42rem] divide-y divide-n-strong overflow-visible transition-all duration-300 ease-in-out top-full justify-between flex flex-col bg-n-alpha-3 border border-n-strong shadow-sm backdrop-blur-[100px] rounded-xl"
|
class="w-[42rem] divide-y divide-n-strong overflow-visible transition-all duration-300 ease-in-out top-full justify-between flex flex-col bg-n-alpha-3 border border-n-strong shadow-sm backdrop-blur-[100px] rounded-xl min-w-0"
|
||||||
>
|
>
|
||||||
<ContactSelector
|
<ContactSelector
|
||||||
:contacts="contacts"
|
:contacts="contacts"
|
||||||
|
|||||||
Reference in New Issue
Block a user