chore: Send with attachment

This commit is contained in:
iamsivin
2025-04-30 11:05:59 +05:30
parent abce44c737
commit e96f296414
2 changed files with 12 additions and 1 deletions
@@ -43,6 +43,7 @@ const isSearching = ref(false);
const messageSignature = useMapGetter('getMessageSignature');
const currentChat = useMapGetter('getSelectedChat');
const currentUser = useMapGetter('getCurrentUser');
const globalConfig = useMapGetter('globalConfig/get');
const fromEmail = computed(() => props.message?.to?.[0]);
@@ -102,6 +103,9 @@ const handleForwardMessage = async ({ state }) => {
name: currentUser.value?.name,
thumbnail: currentUser.value?.avatar_url,
},
files: globalConfig.value?.directUploadsEnabled
? state.attachedFiles.map(file => file.blobSignedId)
: state.attachedFiles.map(file => file.resource.file),
};
await store.dispatch('createPendingMessageAndSend', messagePayload);
emitter.emit(BUS_EVENTS.SCROLL_TO_MESSAGE);
@@ -11,6 +11,7 @@ import {
import ContactSelector from 'dashboard/components-next/NewConversation/components/ContactSelector.vue';
import ActionButtons from 'dashboard/components-next/NewConversation/components/ActionButtons.vue';
import AttachmentPreviews from 'dashboard/components-next/NewConversation/components/AttachmentPreviews.vue';
import EmailMessageEditor from './EmailMessageEditor.vue';
const props = defineProps({
@@ -77,7 +78,7 @@ const setSelectedContact = async ({ value, action, ...rest }) => {
const clearSelectedContact = () => {
emit('clearSelectedContact');
// state.attachedFiles = [];
state.attachedFiles = [];
};
const handleDropdownUpdate = (type, value) => {
@@ -165,6 +166,12 @@ const handleSendMessage = async () => {
:unquoted-html="unquotedHtml"
:text-to-show="textToShow"
/>
<AttachmentPreviews
v-if="state.attachedFiles.length > 0"
:attachments="state.attachedFiles"
class="bg-n-alpha-3"
@update:attachments="state.attachedFiles = $event"
/>
<ActionButtons
class="bg-n-alpha-3 sticky bottom-0 backdrop-blur-[100px]"
:attached-files="state.attachedFiles"