Feature: Support file type messages on widget and dashboard (#659)
- Adds support for file upload Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com> Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
committed by
GitHub
parent
0afa5c297f
commit
7fcd2d0e85
@@ -24,8 +24,8 @@
|
||||
@blur="onBlur()"
|
||||
/>
|
||||
<file-upload
|
||||
v-if="!showFileUpload"
|
||||
accept="image/*"
|
||||
v-if="showFileUpload"
|
||||
:size="4096 * 4096"
|
||||
@input-file="onFileUpload"
|
||||
>
|
||||
<i
|
||||
@@ -105,7 +105,6 @@ export default {
|
||||
message: '',
|
||||
isPrivate: false,
|
||||
showEmojiPicker: false,
|
||||
showFileUpload: false,
|
||||
showCannedResponsesList: false,
|
||||
isUploading: {
|
||||
audio: false,
|
||||
@@ -142,6 +141,9 @@ export default {
|
||||
}
|
||||
return 10000;
|
||||
},
|
||||
showFileUpload() {
|
||||
return this.channelType === 'Channel::WebWidget';
|
||||
},
|
||||
replyButtonLabel() {
|
||||
if (this.isPrivate) {
|
||||
return this.$t('CONVERSATION.REPLYBOX.CREATE');
|
||||
@@ -295,13 +297,7 @@ export default {
|
||||
onFileUpload(file) {
|
||||
this.isUploading.image = true;
|
||||
this.$store
|
||||
.dispatch('sendAttachment', [
|
||||
this.currentChat.id,
|
||||
{
|
||||
file_type: file.type,
|
||||
file: file.file,
|
||||
},
|
||||
])
|
||||
.dispatch('sendAttachment', [this.currentChat.id, { file: file.file }])
|
||||
.then(() => {
|
||||
this.isUploading.image = false;
|
||||
this.$emit('scrollToMessage');
|
||||
|
||||
Reference in New Issue
Block a user