File mode: support drag drop and fix cancellation of uploads

This commit is contained in:
N-Pex 2023-07-06 11:18:26 +02:00
parent fbacf68651
commit 2f29b72594
4 changed files with 125 additions and 67 deletions

View file

@ -16,7 +16,8 @@
v-on:close="showRecorder = false" v-on:file="onVoiceRecording" :sendTypingIndicators="useVoiceMode" />
<FileDropLayout class="file-drop-root" v-if="useFileModeNonAdmin" :room="room"
v-on:add-file="showAttachmentPicker()"
v-on:pick-file="showAttachmentPicker()"
v-on:add-file="addAttachment($event)"
v-on:remove-file="currentFileInputs.splice($event, 1)"
v-on:reset="resetAttachments"
:attachments="currentFileInputs"
@ -1146,6 +1147,10 @@ export default {
this.currentSendError = null;
},
addAttachment(file) {
this.handleFileReader(null, file);
},
resetAttachments() {
this.cancelSendAttachment();
},