1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 09:50:31 +01:00

generic polling

This commit is contained in:
Tim Daubenschütz 2015-07-10 19:00:59 +02:00
parent b6048a7f91
commit 104a72fcc9

View File

@ -42,6 +42,12 @@ let AccordionListItem = React.createClass({
}
},
componentDidUpdate() {
if(this.props.content.num_editions === 0) {
this.startPolling();
}
},
onChange(state) {
this.setState(state);
},
@ -73,6 +79,10 @@ let AccordionListItem = React.createClass({
this.toggleCreateEditionsDialog();
this.startPolling();
},
startPolling() {
// start polling until editions are defined
let pollingIntervalIndex = setInterval(() => {
EditionListActions.fetchEditionList(this.props.content.id)