Merge pull request #127 from lbryio/development
Merge development into master
This commit is contained in:
commit
15d9236500
2 changed files with 7 additions and 2 deletions
|
@ -120,6 +120,7 @@ export let Address = React.createClass({
|
|||
export let Thumbnail = React.createClass({
|
||||
_defaultImageUri: '/img/default-thumb.svg',
|
||||
_maxLoadTime: 10000,
|
||||
_isMounted: false,
|
||||
|
||||
propTypes: {
|
||||
src: React.PropTypes.string.isRequired,
|
||||
|
@ -137,14 +138,18 @@ export let Thumbnail = React.createClass({
|
|||
};
|
||||
},
|
||||
componentDidMount: function() {
|
||||
this._isMounted = true;
|
||||
setTimeout(() => {
|
||||
if (!this.refs.img.complete) {
|
||||
if (this._isMounted && !this.refs.img.complete) {
|
||||
this.setState({
|
||||
imageUri: this._defaultImageUri,
|
||||
});
|
||||
}
|
||||
}, this._maxLoadTime);
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
this._isMounted = false;
|
||||
},
|
||||
render: function() {
|
||||
return <img ref="img" onError={this.handleError} {... this.props} src={this.state.imageUri} />
|
||||
},
|
||||
|
|
|
@ -292,7 +292,7 @@ var DiscoverPage = React.createClass({
|
|||
document.title = "Discover";
|
||||
if (this.props.query) {
|
||||
// Rendering with a query already typed
|
||||
this.handleSearchChanged();
|
||||
this.handleSearchChanged(this.props.query);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue