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
---
 .../admin_console/legal_and_support_settings.jsx     | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

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

diff --git a/webapp/components/admin_console/legal_and_support_settings.jsx b/webapp/components/admin_console/legal_and_support_settings.jsx
index 33494b36f..4eab71c64 100644
--- a/webapp/components/admin_console/legal_and_support_settings.jsx
+++ b/webapp/components/admin_console/legal_and_support_settings.jsx
@@ -15,15 +15,6 @@ export default class LegalAndSupportSettings extends AdminSettings {
         this.getConfigFromState = this.getConfigFromState.bind(this);
 
         this.renderSettings = this.renderSettings.bind(this);
-
-        this.state = Object.assign(this.state, {
-            termsOfServiceLink: props.config.SupportSettings.TermsOfServiceLink,
-            privacyPolicyLink: props.config.SupportSettings.PrivacyPolicyLink,
-            aboutLink: props.config.SupportSettings.AboutLink,
-            helpLink: props.config.SupportSettings.HelpLink,
-            reportAProblemLink: props.config.SupportSettings.ReportAProblemLink,
-            supportEmail: props.config.SupportSettings.SupportEmail
-        });
     }
 
     getConfigFromState(config) {
@@ -37,6 +28,17 @@ export default class LegalAndSupportSettings extends AdminSettings {
         return config;
     }
 
+    getStateFromConfig(config) {
+        return {
+            termsOfServiceLink: config.SupportSettings.TermsOfServiceLink,
+            privacyPolicyLink: config.SupportSettings.PrivacyPolicyLink,
+            aboutLink: config.SupportSettings.AboutLink,
+            helpLink: config.SupportSettings.HelpLink,
+            reportAProblemLink: config.SupportSettings.ReportAProblemLink,
+            supportEmail: config.SupportSettings.SupportEmail
+        };
+    }
+
     renderTitle() {
         return (
             <h3>
-- 
cgit v1.2.3-1-g7c22

