From dd6a9ae6458784b36ffe2376492284ae4e79fece Mon Sep 17 00:00:00 2001 From: Rinpatch Date: Thu, 13 Dec 2018 17:51:29 +0300 Subject: [PATCH] oof --- src/components/user_settings/user_settings.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 88cdb3bf..43e39b13 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -78,10 +78,9 @@ const UserSettings = { uploadFile (slot, e) { const file = e.target.files[0] if (!file) { return } - var limit = [this.$store.state.instance.avatarlimit, this.$store.state.instance.bannerlimit, this.$store.state.instance.backgroundlimit] - if (file.size > limit[slot]) { + if (file.size > this.$store.state.instance[slot + 'limit']) { const filesize = fileSizeFormatService.fileSizeFormat(file.size) - const allowedsize = fileSizeFormatService.fileSizeFormat(limit[slot]) + const allowedsize = fileSizeFormatService.fileSizeFormat(this.$store.state.instance[slot + 'limit']) this[slot + 'UploadError'] = this.$t('upload.error.base') + ' ' + this.$t('upload.error.file_too_big', {filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit}) return }