mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixed EmailAuthenticationSettings mutating the stored config (#4743)
This commit is contained in:
committed by
Joram Wilander
parent
d7ee335106
commit
e068c1d58e
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user