mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Move compnentDidUpdate for ESLint warning
This commit is contained in:
parent
847b59366c
commit
f82797bea3
@ -28,6 +28,12 @@ let CreateEditionsButton = React.createClass({
|
|||||||
EditionListStore.listen(this.onChange);
|
EditionListStore.listen(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
if(this.props.piece.num_editions === 0 && typeof this.state.pollingIntervalIndex === 'undefined') {
|
||||||
|
this.startPolling();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
EditionListStore.unlisten(this.onChange);
|
EditionListStore.unlisten(this.onChange);
|
||||||
clearInterval(this.state.pollingIntervalIndex);
|
clearInterval(this.state.pollingIntervalIndex);
|
||||||
@ -37,12 +43,6 @@ let CreateEditionsButton = React.createClass({
|
|||||||
this.setState(state);
|
this.setState(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate() {
|
|
||||||
if(this.props.piece.num_editions === 0 && typeof this.state.pollingIntervalIndex === 'undefined') {
|
|
||||||
this.startPolling();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
startPolling() {
|
startPolling() {
|
||||||
// start polling until editions are defined
|
// start polling until editions are defined
|
||||||
let pollingIntervalIndex = setInterval(() => {
|
let pollingIntervalIndex = setInterval(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user