From 9309ad9d7a4684440234989f658c66bae3c1052f Mon Sep 17 00:00:00 2001
From: Jonathan <jonfritz@gmail.com>
Date: Wed, 9 Aug 2017 16:33:31 -0400
Subject: PLT-7301: Removed props mutation that was causing JS error, now
 passing locale as a prop directly instead of fetching it out of the user
 object (#7162)

---
 webapp/components/user_settings/manage_languages.jsx | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

(limited to 'webapp/components/user_settings/manage_languages.jsx')

diff --git a/webapp/components/user_settings/manage_languages.jsx b/webapp/components/user_settings/manage_languages.jsx
index 2cb38068b..f83733c12 100644
--- a/webapp/components/user_settings/manage_languages.jsx
+++ b/webapp/components/user_settings/manage_languages.jsx
@@ -16,18 +16,14 @@ export default class ManageLanguage extends React.Component {
     constructor(props) {
         super(props);
 
-        this.setupInitialState = this.setupInitialState.bind(this);
         this.setLanguage = this.setLanguage.bind(this);
         this.changeLanguage = this.changeLanguage.bind(this);
         this.submitUser = this.submitUser.bind(this);
-        this.state = this.setupInitialState(props);
-    }
-    setupInitialState(props) {
-        var user = props.user;
-        return {
-            locale: user.locale
+        this.state = {
+            locale: props.locale
         };
     }
+
     setLanguage(e) {
         this.setState({locale: e.target.value});
     }
@@ -134,5 +130,6 @@ export default class ManageLanguage extends React.Component {
 
 ManageLanguage.propTypes = {
     user: PropTypes.object.isRequired,
+    locale: PropTypes.string.isRequired,
     updateSection: PropTypes.func.isRequired
 };
-- 
cgit v1.2.3-1-g7c22

