forked from p15670423/monkey
ui: pass callback, not return value, to setState()
This commit is contained in:
parent
f094efba8f
commit
7079a6fd23
|
@ -355,14 +355,13 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
|
|
||||||
attemptSetConfigFromCandidateJson(newConfigCandidateJson){
|
attemptSetConfigFromCandidateJson(newConfigCandidateJson){
|
||||||
this.setState({lastAction: 'import_attempt', candidateConfigJson: newConfigCandidateJson},
|
this.setState({lastAction: 'import_attempt', candidateConfigJson: newConfigCandidateJson},
|
||||||
this.setConfigFromCandidateJson(newConfigCandidateJson)
|
this.setConfigFromCandidateJson
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
setConfigFromCandidateJson(newConfigCandidateJson){
|
setConfigFromCandidateJson(){
|
||||||
try {
|
try {
|
||||||
this.setState({lastAction: 'import_attempt', candidateConfigJson: newConfigCandidateJson})
|
let newConfig = JSON.parse(this.state.candidateConfigJson);
|
||||||
let newConfig = JSON.parse(newConfigCandidateJson);
|
|
||||||
|
|
||||||
if (!this.canSafelySubmitConfig(newConfig)) {
|
if (!this.canSafelySubmitConfig(newConfig)) {
|
||||||
this.setState({showUnsafeOptionsConfirmation: true});
|
this.setState({showUnsafeOptionsConfirmation: true});
|
||||||
|
|
Loading…
Reference in New Issue