aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_upload
diff options
context:
space:
mode:
authorRinpatch <rinpatch@sdf.org>2018-12-10 09:50:04 +0300
committerRinpatch <rinpatch@sdf.org>2018-12-10 09:50:04 +0300
commitc69a8dc197c87eb69272c28c1c1501e3c6d6d9aa (patch)
treef8d466d8082c3021bd35da4b3230510233d9462f /src/components/media_upload
parent4fde987e34c6b76c67d73ff1d163e8a5fed53069 (diff)
Add file size formating
Diffstat (limited to 'src/components/media_upload')
-rw-r--r--src/components/media_upload/media_upload.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js
index 91ae3627..1927a194 100644
--- a/src/components/media_upload/media_upload.js
+++ b/src/components/media_upload/media_upload.js
@@ -1,5 +1,7 @@
/* eslint-env browser */
import statusPosterService from '../../services/status_poster/status_poster.service.js'
+import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
+
const mediaUpload = {
mounted () {
@@ -22,7 +24,7 @@ const mediaUpload = {
const self = this
const store = this.$store
if (file.size > store.state.instance.uploadlimit) {
- self.$emit('upload-failed', 'upload_error_file_too_big', {filesize: file.size, allowedsize: store.state.instance.uploadlimit})
+ self.$emit('upload-failed', 'upload_error_file_too_big', {filesize: fileSizeFormatService.fileSizeFormat(file.size, self.$t), allowedsize: fileSizeFormatService.fileSizeFormat(store.state.instance.uploadlimit, self.$t)})
return
}
const formData = new FormData()