mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
fix create editions for filter widget
This commit is contained in:
parent
ee97e600ef
commit
e227db1b3b
@ -42,18 +42,19 @@ let CreateEditionsButton = React.createClass({
|
||||
},
|
||||
|
||||
startPolling() {
|
||||
let filterBy = this.state.editionList[this.props.piece.id].filterBy;
|
||||
// start polling until editions are defined
|
||||
let pollingIntervalIndex = setInterval(() => {
|
||||
|
||||
EditionListActions.fetchEditionList(this.props.piece.id, null, null, null, null, filterBy)
|
||||
// requests, will try to merge the filterBy parameter with other parameters (mergeOptions).
|
||||
// Therefore it can't but null but instead has to be an empty object
|
||||
EditionListActions.fetchEditionList(this.props.piece.id, null, null, null, null, {})
|
||||
.then((res) => {
|
||||
|
||||
clearInterval(this.state.pollingIntervalIndex);
|
||||
this.props.onPollingSuccess(this.props.piece.id, res.editions[0].num_editions);
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
.catch((err) => {
|
||||
/* Ignore and keep going */
|
||||
});
|
||||
}, 5000);
|
||||
|
Loading…
Reference in New Issue
Block a user