summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_settings.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-07-23 11:37:59 -0700
committernickago <ngonella@calpoly.edu>2015-07-23 11:37:59 -0700
commitebddb6c6b05d251f1e87b918eaec59ab09cd97a1 (patch)
tree5d9ea9c5d68e3bc6f89cf820fd082ca27e9d06f1 /web/react/components/user_settings.jsx
parentdc79707787b521ea5fc0d9088ccd9069780c8e0c (diff)
downloadchat-ebddb6c6b05d251f1e87b918eaec59ab09cd97a1.tar.gz
chat-ebddb6c6b05d251f1e87b918eaec59ab09cd97a1.tar.bz2
chat-ebddb6c6b05d251f1e87b918eaec59ab09cd97a1.zip
Added support for png profile pictures
Diffstat (limited to 'web/react/components/user_settings.jsx')
-rw-r--r--web/react/components/user_settings.jsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index 1fbbf16ed..0f600a813 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -683,13 +683,15 @@ 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"});
+ var picture = this.state.picture;
+
+ if(picture.type !== "image/jpeg" && picture.type !== "image/png") {
+ this.setState({client_error: "Only JPG or PNG images may be used for profile pictures"});
return;
}
formData = new FormData();
- formData.append('image', this.state.picture, this.state.picture.name);
+ formData.append('image', picture, picture.name);
client.uploadProfileImage(formData,
function(data) {