really fix issues with random topic on first load
This commit is contained in:
parent
c9d1495c43
commit
f667e9ea8f
|
@ -18,10 +18,11 @@ class Home extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
console.log('nextProps', nextProps);
|
||||||
// This is slightly awkward - we need to check that we have all topics,
|
// This is slightly awkward - we need to check that we have all topics,
|
||||||
// But don't have a random topic yet (or at not already loading a random topic)
|
// But don't have a random topic yet (or at not already loading a random topic)
|
||||||
if (this.props.allTopics && !(this.props.loadingRandomTopic || nextProps.loadingRandomTopic) && !this.props.randomTopic) {
|
if ((this.props.allTopics || nextProps.allTopics) && !this.props.loadingRandomTopic && !nextProps.loadingRandomTopic && !this.props.randomTopic) {
|
||||||
this.props.getRandomTopicVideos(this.props.allTopics);
|
this.props.getRandomTopicVideos(nextProps.allTopics);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user