summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_settings.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-07-01 16:04:18 -0700
committernickago <ngonella@calpoly.edu>2015-07-01 16:04:18 -0700
commit6f83b0fd2c64f36f59bf0c0ac7fa87f6da1e65c9 (patch)
tree163e34620e4cab5ca98232e45bd47fe7a5188059 /web/react/components/user_settings.jsx
parent5e204030ffe91aaab090a26547185017edf1d2e1 (diff)
downloadchat-6f83b0fd2c64f36f59bf0c0ac7fa87f6da1e65c9.tar.gz
chat-6f83b0fd2c64f36f59bf0c0ac7fa87f6da1e65c9.tar.bz2
chat-6f83b0fd2c64f36f59bf0c0ac7fa87f6da1e65c9.zip
Restricted profile picture uploads to just JPEGs
Diffstat (limited to 'web/react/components/user_settings.jsx')
-rw-r--r--web/react/components/user_settings.jsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index f97a06db3..2e563ff45 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -809,6 +809,11 @@ var GeneralTab = React.createClass({
if(!this.submitActive) return;
+ if(this.state.picture.type !== "image/jpeg") {
+ this.setState({client_error: "Only JPG images may be used for profile pictures"});
+ return;
+ }
+
formData = new FormData();
formData.append('image', this.state.picture, this.state.picture.name);
@@ -984,7 +989,7 @@ var GeneralTab = React.createClass({
submit={this.submitPicture}
src={"/api/v1/users/" + user.id + "/image"}
server_error={server_error}
- client_error={email_error}
+ client_error={client_error}
updateSection={function(e){self.updateSection("");e.preventDefault();}}
picture={this.state.picture}
pictureChange={this.updatePicture}