Commit 94a16aec authored by Martin Santangelo's avatar Martin Santangelo
Browse files

(fix) remove deprecated componentWillMount in discovery

parent 22311a3e
Loading
Loading
Loading
Loading
+17 −10
Original line number Diff line number Diff line
@@ -86,10 +86,26 @@ export default class DiscoveryScreen extends Component {
    }
  }

  /**
   * constructor
   */
  constructor(props) {
    super(props);

    this.props.discovery.init();

    const params = this.props.navigation.state.params;
    if (params && params.type) {
      this.props.discovery.filters.setType(params.type);
    }

    this.tileError = i18n.t('error');
  }

  /**
   * On component will mount
   */
  componentWillMount() {
  componentDidMount() {
    // load data on enter
    this.disposeEnter = this.props.navigation.addListener('didFocus', (s) => {
      setTimeout(() => {
@@ -103,15 +119,6 @@ export default class DiscoveryScreen extends Component {
        this.setState({active: false});
      }, 50);
    });

    this.props.discovery.init();

    const params = this.props.navigation.state.params;
    if (params && params.type) {
      this.props.discovery.filters.setType(params.type);
    }

    this.tileError = i18n.t('error');
  }

  /**