mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
fix polling endless loop
This commit is contained in:
parent
7cc5585eb1
commit
e56fbbac2b
@ -19,11 +19,9 @@ let AccordionListItem = React.createClass({
|
|||||||
content: React.PropTypes.object,
|
content: React.PropTypes.object,
|
||||||
children: React.PropTypes.object
|
children: React.PropTypes.object
|
||||||
},
|
},
|
||||||
handleClick(event){
|
handleClick(){
|
||||||
requests.get('piece_first_edition_id', {'piece_id': this.props.content.id})
|
requests.get('piece_first_edition_id', {'piece_id': this.props.content.id})
|
||||||
.then((res) => this.transitionTo('edition', {editionId: res.bitcoin_id}));
|
.then((res) => this.transitionTo('edition', {editionId: res.bitcoin_id}));
|
||||||
|
|
||||||
console.log(event.target);
|
|
||||||
},
|
},
|
||||||
getGlyphicon(){
|
getGlyphicon(){
|
||||||
if (this.props.content.requestAction){
|
if (this.props.content.requestAction){
|
||||||
@ -53,6 +51,7 @@ let AccordionListItem = React.createClass({
|
|||||||
<h3>{getLangText('by %s', this.props.content.artist_name)}</h3>
|
<h3>{getLangText('by %s', this.props.content.artist_name)}</h3>
|
||||||
<div>
|
<div>
|
||||||
<span>{this.props.content.date_created.split('-')[0]}</span>
|
<span>{this.props.content.date_created.split('-')[0]}</span>
|
||||||
|
<span className="pull-right">this.props.</span>
|
||||||
{/* <a href={this.props.content.license_type.url} target="_blank" className="pull-right">
|
{/* <a href={this.props.content.license_type.url} target="_blank" className="pull-right">
|
||||||
{getLangText('%s license', this.props.content.license_type.code)}
|
{getLangText('%s license', this.props.content.license_type.code)}
|
||||||
</a> */}
|
</a> */}
|
||||||
|
@ -133,25 +133,6 @@ let Video = React.createClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
let EncodingStatus = React.createClass({
|
|
||||||
propTypes: {
|
|
||||||
encodingStatus: React.PropTypes.number.isRequired
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<video ref="video" className="video-js vjs-default-skin" poster={this.props.preview}
|
|
||||||
controls preload="none" width="auto" height="auto">
|
|
||||||
{this.props.extraData.map((data, i) =>
|
|
||||||
<source key={i} type={'video/' + data.type} src={data.url} />
|
|
||||||
)}
|
|
||||||
</video>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
let resourceMap = {
|
let resourceMap = {
|
||||||
'image': Image,
|
'image': Image,
|
||||||
'video': Video,
|
'video': Video,
|
||||||
|
@ -17,10 +17,10 @@ let EditionContainer = React.createClass({
|
|||||||
|
|
||||||
onChange(state) {
|
onChange(state) {
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
let isEncoding = state.edition.digital_work.isEncoding;
|
let isEncoding = state.edition.digital_work ? state.edition.digital_work.isEncoding : null;
|
||||||
if (isEncoding !== undefined && isEncoding !== 100) {
|
if (typeof isEncoding === 'number' && isEncoding !== 100 && !this.state.timerId) {
|
||||||
let timerId = window.setInterval(() => EditionActions.fetchOne(this.props.params.editionId), 10000);
|
let timerId = window.setInterval(() => EditionActions.fetchOne(this.props.params.editionId), 10000);
|
||||||
this.setState({timerId: timerId})
|
this.setState({timerId: timerId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user