pull kapacitor connection checks out of callbacks

pull/10616/head
Jade McGough 2017-05-08 11:32:35 -07:00
parent b048cefa80
commit 74760ab2b4
1 changed files with 4 additions and 6 deletions

View File

@ -72,9 +72,8 @@ class KapacitorPage extends Component {
if (exists) {
updateKapacitor(kapacitor)
.then(({data}) => {
this.setState({kapacitor: data}, () =>
this.checkKapacitorConnection(data)
)
this.setState({kapacitor: data})
this.checkKapacitorConnection(data)
addFlashMessage({type: 'success', text: 'Kapacitor Updated!'})
})
.catch(() => {
@ -87,9 +86,8 @@ class KapacitorPage extends Component {
createKapacitor(source, kapacitor)
.then(({data}) => {
// need up update kapacitor with info from server to AlertOutputs
this.setState({kapacitor: data}, () =>
this.checkKapacitorConnection(data)
)
this.setState({kapacitor: data})
this.checkKapacitorConnection(data)
addFlashMessage({type: 'success', text: 'Kapacitor Created!'})
})
.catch(() => {