mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 05:31:58 +02: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() {
|
startPolling() {
|
||||||
let filterBy = this.state.editionList[this.props.piece.id].filterBy;
|
|
||||||
// start polling until editions are defined
|
// start polling until editions are defined
|
||||||
let pollingIntervalIndex = setInterval(() => {
|
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) => {
|
.then((res) => {
|
||||||
|
|
||||||
clearInterval(this.state.pollingIntervalIndex);
|
clearInterval(this.state.pollingIntervalIndex);
|
||||||
this.props.onPollingSuccess(this.props.piece.id, res.editions[0].num_editions);
|
this.props.onPollingSuccess(this.props.piece.id, res.editions[0].num_editions);
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((err) => {
|
||||||
/* Ignore and keep going */
|
/* Ignore and keep going */
|
||||||
});
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user