mirror of
https://github.com/ascribe/onion.git
synced 2025-02-01 20:39:57 +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,
|
||||
children: React.PropTypes.object
|
||||
},
|
||||
handleClick(event){
|
||||
handleClick(){
|
||||
requests.get('piece_first_edition_id', {'piece_id': this.props.content.id})
|
||||
.then((res) => this.transitionTo('edition', {editionId: res.bitcoin_id}));
|
||||
|
||||
console.log(event.target);
|
||||
},
|
||||
getGlyphicon(){
|
||||
if (this.props.content.requestAction){
|
||||
@ -53,6 +51,7 @@ let AccordionListItem = React.createClass({
|
||||
<h3>{getLangText('by %s', this.props.content.artist_name)}</h3>
|
||||
<div>
|
||||
<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">
|
||||
{getLangText('%s license', this.props.content.license_type.code)}
|
||||
</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 = {
|
||||
'image': Image,
|
||||
'video': Video,
|
||||
|
@ -17,10 +17,10 @@ let EditionContainer = React.createClass({
|
||||
|
||||
onChange(state) {
|
||||
this.setState(state);
|
||||
let isEncoding = state.edition.digital_work.isEncoding;
|
||||
if (isEncoding !== undefined && isEncoding !== 100) {
|
||||
let isEncoding = state.edition.digital_work ? state.edition.digital_work.isEncoding : null;
|
||||
if (typeof isEncoding === 'number' && isEncoding !== 100 && !this.state.timerId) {
|
||||
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