summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-12-09 07:54:12 -0500
committerJoram Wilander <jwawilander@gmail.com>2016-12-09 07:54:12 -0500
commite068c1d58efe1683fd4f3ef454036734a97bc6ee (patch)
tree631cb5581bd056fa11ee380646ed05a29f062b40 /webapp/components/admin_console
parentd7ee335106b4f3497d78f2e48d356f0ea89fea27 (diff)
downloadchat-e068c1d58efe1683fd4f3ef454036734a97bc6ee.tar.gz
chat-e068c1d58efe1683fd4f3ef454036734a97bc6ee.tar.bz2
chat-e068c1d58efe1683fd4f3ef454036734a97bc6ee.zip
Fixed EmailAuthenticationSettings mutating the stored config (#4743)
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/email_connection_test.jsx8
-rw-r--r--webapp/components/admin_console/email_settings.jsx3
2 files changed, 8 insertions, 3 deletions
diff --git a/webapp/components/admin_console/email_connection_test.jsx b/webapp/components/admin_console/email_connection_test.jsx
index f96d540d6..8e11a0bb4 100644
--- a/webapp/components/admin_console/email_connection_test.jsx
+++ b/webapp/components/admin_console/email_connection_test.jsx
@@ -12,6 +12,7 @@ export default class EmailConnectionTestButton extends React.Component {
static get propTypes() {
return {
config: React.PropTypes.object.isRequired,
+ getConfigFromState: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired
};
}
@@ -37,8 +38,11 @@ export default class EmailConnectionTestButton extends React.Component {
fail: null
});
+ const config = JSON.parse(JSON.stringify(this.props.config));
+ this.props.getConfigFromState(config);
+
Client.testEmail(
- this.props.config,
+ config,
() => {
this.setState({
testing: false,
@@ -120,4 +124,4 @@ export default class EmailConnectionTestButton extends React.Component {
</div>
);
}
-} \ No newline at end of file
+}
diff --git a/webapp/components/admin_console/email_settings.jsx b/webapp/components/admin_console/email_settings.jsx
index d62c5ad4c..bd9a530ba 100644
--- a/webapp/components/admin_console/email_settings.jsx
+++ b/webapp/components/admin_console/email_settings.jsx
@@ -272,7 +272,8 @@ export default class EmailSettings extends AdminSettings {
disabled={!this.state.sendEmailNotifications}
/>
<EmailConnectionTest
- config={this.getConfigFromState(this.props.config)}
+ config={this.props.config}
+ getConfigFromState={this.getConfigFromState}
disabled={!this.state.sendEmailNotifications}
/>
<BooleanSetting