From b114062c1b8128fe650fce72454ba4f1fcbe5733 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Wed, 6 Jul 2016 16:07:56 -0400
Subject: PLT-3237 Update displayed config values in admin console after saving
 (#3506)

* Reloaded admin console data when settings are saved

* Fixed attempting to save an invalid config setting overwriting the stored config
---
 webapp/components/admin_console/login_settings.jsx | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

(limited to 'webapp/components/admin_console/login_settings.jsx')

diff --git a/webapp/components/admin_console/login_settings.jsx b/webapp/components/admin_console/login_settings.jsx
index 0ac81bc33..651d8352b 100644
--- a/webapp/components/admin_console/login_settings.jsx
+++ b/webapp/components/admin_console/login_settings.jsx
@@ -19,12 +19,6 @@ export default class LoginSettings extends AdminSettings {
         this.getConfigFromState = this.getConfigFromState.bind(this);
 
         this.renderSettings = this.renderSettings.bind(this);
-
-        this.state = Object.assign(this.state, {
-            passwordResetSalt: props.config.EmailSettings.PasswordResetSalt,
-            maximumLoginAttempts: props.config.ServiceSettings.MaximumLoginAttempts,
-            enableMultifactorAuthentication: props.config.ServiceSettings.EnableMultifactorAuthentication
-        });
     }
 
     getConfigFromState(config) {
@@ -37,6 +31,14 @@ export default class LoginSettings extends AdminSettings {
         return config;
     }
 
+    getStateFromConfig(config) {
+        return {
+            passwordResetSalt: config.EmailSettings.PasswordResetSalt,
+            maximumLoginAttempts: config.ServiceSettings.MaximumLoginAttempts,
+            enableMultifactorAuthentication: config.ServiceSettings.EnableMultifactorAuthentication
+        };
+    }
+
     renderTitle() {
         return (
             <h3>
-- 
cgit v1.2.3-1-g7c22

