chore: Send with attachment
This commit is contained in:
@@ -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);
|
||||
|
||||
+8
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user