diff options
author | Thomas Balthazar <tbalthazar@users.noreply.github.com> | 2016-07-05 21:37:21 +0200 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-07-05 15:37:21 -0400 |
commit | f4dd8e579639637057e8717067bb0627d9eb1de3 (patch) | |
tree | 7c5795636c052e35849df95a07778bae38f54969 /webapp/components/user_settings/user_settings_general.jsx | |
parent | 71bd413b257afd376e1e6fb4c229f70bdb9381c1 (diff) | |
download | chat-f4dd8e579639637057e8717067bb0627d9eb1de3.tar.gz chat-f4dd8e579639637057e8717067bb0627d9eb1de3.tar.bz2 chat-f4dd8e579639637057e8717067bb0627d9eb1de3.zip |
PLT-1316/PLT-3280 Change client-side max file size limit (#3354)
* Change client-side max file size limit
It now relies on the value set in config.json.
Re-enable and tweak the max file size setting in system console.
* Update file upload error message
Diffstat (limited to 'webapp/components/user_settings/user_settings_general.jsx')
-rw-r--r-- | webapp/components/user_settings/user_settings_general.jsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx index 37264fb7e..f8910b9bc 100644 --- a/webapp/components/user_settings/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general.jsx @@ -95,6 +95,7 @@ class UserSettingsGeneralTab extends React.Component { this.updateSection = this.updateSection.bind(this); this.state = this.setupInitialState(props); + this.setState({maxFileSize: global.window.mm_config.MaxFileSize}); } submitUsername(e) { e.preventDefault(); @@ -221,7 +222,7 @@ class UserSettingsGeneralTab extends React.Component { if (picture.type !== 'image/jpeg' && picture.type !== 'image/png') { this.setState({clientError: formatMessage(holders.validImage)}); return; - } else if (picture.size > Constants.MAX_FILE_SIZE) { + } else if (picture.size > this.state.maxFileSize) { this.setState({clientError: formatMessage(holders.imageTooLarge)}); return; } |