chore: Minor fix

This commit is contained in:
iamsivin
2024-11-18 22:10:23 +05:30
parent 99c762404e
commit 2e30d4b825
2 changed files with 20 additions and 19 deletions
@@ -49,36 +49,37 @@ const onContactSearch = debounce(
);
const handleSelectedContact = async ({ value, action, ...rest }) => {
try {
let contact;
let contact;
if (action === 'create') {
isCreatingContact.value = true;
try {
contact = await createNewContact(value);
isCreatingContact.value = false;
} catch (error) {
isCreatingContact.value = false;
return;
}
} else {
contact = rest;
if (action === 'create') {
isCreatingContact.value = true;
try {
contact = await createNewContact(value);
isCreatingContact.value = false;
} catch (error) {
isCreatingContact.value = false;
return;
}
selectedContact.value = contact;
} else {
contact = rest;
}
selectedContact.value = contact;
if (contact?.id) {
isFetchingInboxes.value = true;
if (contact?.id) {
isFetchingInboxes.value = true;
try {
const contactableInboxes = await fetchContactableInboxes(contact.id);
selectedContact.value.contactInboxes = contactableInboxes;
isFetchingInboxes.value = false;
} catch (error) {
isFetchingInboxes.value = false;
}
} catch (error) {
isCreatingContact.value = false;
}
};
const handleTargetInbox = inbox => {
targetInbox.value = inbox;
onContactSearch('');
};
const clearSelectedContact = () => {
@@ -176,7 +176,7 @@ const { onFileUpload } = useFileUpload({
</FileUpload>
<Button
v-if="isEmailOrWebWidgetInbox"
icon="i-lucide-type"
icon="i-lucide-signature"
color="slate"
size="sm"
class="!w-10"