Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-04-28 19:02:14 +0300
committerVincent Petry <vincent@nextcloud.com>2021-04-29 10:47:21 +0300
commitb9632cf7a380e5d86391b780bcfb89f11f8ff51e (patch)
tree3aa19901f48a7469ffc732b707c994ceda2dbaf8 /src/components
parent0bb284b5eeaf72ccabdbf9a9377d3e7d283b8747 (diff)
Decuple fileUpload service from the global store
Moved the logic of "processFiles" into the existing "initialiseUpload" action of the fileUploadStore Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ChatView.vue3
-rw-r--r--src/components/NewMessageForm/NewMessageForm.vue3
-rw-r--r--src/components/UploadEditor.vue3
3 files changed, 3 insertions, 6 deletions
diff --git a/src/components/ChatView.vue b/src/components/ChatView.vue
index 105fafa88..2a76975db 100644
--- a/src/components/ChatView.vue
+++ b/src/components/ChatView.vue
@@ -59,7 +59,6 @@
<script>
import MessagesList from './MessagesList/MessagesList'
import NewMessageForm from './NewMessageForm/NewMessageForm'
-import { processFiles } from '../utils/fileUpload'
import { CONVERSATION } from '../constants'
export default {
@@ -140,7 +139,7 @@ export default {
// Create a unique id for the upload operation
const uploadId = new Date().getTime()
// Uploads and shares the files
- processFiles(files, this.token, uploadId)
+ this.$store.dispatch('initialiseUpload', { files, token: this.token, uploadId })
},
setScrollStatus(payload) {
diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue
index 548740494..dad481a64 100644
--- a/src/components/NewMessageForm/NewMessageForm.vue
+++ b/src/components/NewMessageForm/NewMessageForm.vue
@@ -125,7 +125,6 @@ import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import EmojiPicker from '@nextcloud/vue/dist/Components/EmojiPicker'
import { EventBus } from '../../services/EventBus'
import { shareFile } from '../../services/filesSharingServices'
-import { processFiles } from '../../utils/fileUpload'
import { CONVERSATION } from '../../constants'
import createTemporaryMessage from '../../utils/temporaryMessage'
import EmoticonOutline from 'vue-material-design-icons/EmoticonOutline'
@@ -457,7 +456,7 @@ export default {
// Create a unique id for the upload operation
const uploadId = new Date().getTime()
// Uploads and shares the files
- await processFiles(files, this.token, uploadId, rename)
+ this.$store.dispatch('initialiseUpload', { files, token: this.token, uploadId, rename })
},
/**
diff --git a/src/components/UploadEditor.vue b/src/components/UploadEditor.vue
index 359e5dcb2..5a95d02eb 100644
--- a/src/components/UploadEditor.vue
+++ b/src/components/UploadEditor.vue
@@ -70,7 +70,6 @@
import Modal from '@nextcloud/vue/dist/Components/Modal'
import FilePreview from './MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue'
import Plus from 'vue-material-design-icons/Plus'
-import { processFiles } from '../utils/fileUpload'
export default {
name: 'UploadEditor',
@@ -138,7 +137,7 @@ export default {
handleFileInput(event) {
const files = Object.values(event.target.files)
- processFiles(files, this.token, this.currentUploadId)
+ this.$store.dispatch('initialiseUpload', { files, token: this.token, uploadId: this.currentUploadId })
},
handleRemoveFileFromSelection(id) {