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
---
 .../components/admin_console/external_service_settings.jsx   | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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

diff --git a/webapp/components/admin_console/external_service_settings.jsx b/webapp/components/admin_console/external_service_settings.jsx
index ab8601858..ebeb78332 100644
--- a/webapp/components/admin_console/external_service_settings.jsx
+++ b/webapp/components/admin_console/external_service_settings.jsx
@@ -17,11 +17,6 @@ export default class ExternalServiceSettings extends AdminSettings {
         this.getConfigFromState = this.getConfigFromState.bind(this);
 
         this.renderSettings = this.renderSettings.bind(this);
-
-        this.state = Object.assign(this.state, {
-            segmentDeveloperKey: props.config.ServiceSettings.SegmentDeveloperKey,
-            googleDeveloperKey: props.config.ServiceSettings.GoogleDeveloperKey
-        });
     }
 
     getConfigFromState(config) {
@@ -31,6 +26,13 @@ export default class ExternalServiceSettings extends AdminSettings {
         return config;
     }
 
+    getStateFromConfig(config) {
+        return {
+            segmentDeveloperKey: config.ServiceSettings.SegmentDeveloperKey,
+            googleDeveloperKey: config.ServiceSettings.GoogleDeveloperKey
+        };
+    }
+
     renderTitle() {
         return (
             <h3>
-- 
cgit v1.2.3-1-g7c22

