From 6a008541898e354fbd98857787020640407b1dd3 Mon Sep 17 00:00:00 2001 From: Rinpatch Date: Mon, 10 Dec 2018 17:06:32 +0300 Subject: Count in binary bytes and remove i18 from file size format service --- src/components/media_upload/media_upload.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/components/media_upload/media_upload.js') diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js index 37dab32b..31d36487 100644 --- a/src/components/media_upload/media_upload.js +++ b/src/components/media_upload/media_upload.js @@ -23,7 +23,9 @@ 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: fileSizeFormatService.fileSizeFormat(file.size, self.$t), allowedsize: fileSizeFormatService.fileSizeFormat(store.state.instance.uploadlimit, self.$t)}) + const filesize = fileSizeFormatService.fileSizeFormat(file.size) + const allowedsize = fileSizeFormatService.fileSizeFormat(store.state.instance.uploadlimit) + self.$emit('upload-failed', 'upload_error_file_too_big', {filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit}) return } const formData = new FormData() -- cgit v1.2.3-70-g09d2