1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 00:28:00 +02:00

fix create editions for filter widget

This commit is contained in:
Tim Daubenschütz 2015-08-06 13:43:53 +02:00
parent ee97e600ef
commit e227db1b3b

View File

@ -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);