More send media optimization
This commit is contained in:
parent
7b4b35762a
commit
9b0a6ae225
5 changed files with 54 additions and 55 deletions
|
|
@ -1392,15 +1392,6 @@ export default {
|
|||
this.$refs.attachment.click();
|
||||
},
|
||||
|
||||
addAttachment(file) {
|
||||
if (file) {
|
||||
if (!this.uploadBatch) {
|
||||
this.uploadBatch = this.$matrix.attachmentManager.createUpload(this.room);
|
||||
}
|
||||
this.uploadBatch?.addAttachment(this.$matrix.attachmentManager.createAttachment(file));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle picked attachment
|
||||
*/
|
||||
|
|
@ -1411,7 +1402,10 @@ export default {
|
|||
},
|
||||
|
||||
addAttachments(files) {
|
||||
files.forEach(file => this.addAttachment(file));
|
||||
if (!this.uploadBatch) {
|
||||
this.uploadBatch = this.$matrix.attachmentManager.createUpload(this.room);
|
||||
}
|
||||
this.uploadBatch?.addAttachments(files.map((f) => this.$matrix.attachmentManager.createAttachment(f)));
|
||||
},
|
||||
|
||||
showStickerPicker() {
|
||||
|
|
@ -1862,7 +1856,7 @@ export default {
|
|||
|
||||
onVoiceRecording(event) {
|
||||
const batch = this.$matrix.attachmentManager.createUpload(this.room);
|
||||
batch.addAttachment(this.$matrix.attachmentManager.createAttachment(event.file));
|
||||
batch.addAttachments([this.$matrix.attachmentManager.createAttachment(event.file)]);
|
||||
var text = undefined;
|
||||
if (this.currentInput && this.currentInput.length > 0) {
|
||||
text = this.currentInput;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue