dont reload random topic on home view if random topic exists, fixes #10

This commit is contained in:
Sanjay Bhangar 2018-12-13 16:12:35 +02:00
parent 4c2a3361eb
commit 9fe634dfd5

View File

@ -10,7 +10,7 @@ import Header from "../components/Header";
class Home extends React.Component {
componentDidMount() {
if (this.props.allTopics && this.props.allTopics.length > 0) {
if (this.props.allTopics && this.props.allTopics.length > 0 && !this.props.randomTopic) {
this.props.getRandomTopicVideos(this.props.allTopics);
} else {
this.props.getAllTopics();