import React, { Component } from 'react' import { Loader } from 'app/common' import actions from 'app/actions' export default class EditorGate extends Component { constructor(props) { super(props) this.load() } componentDidUpdate(prevProps) { if (this.props.episode_id !== prevProps.episode_id) { this.load() } } load() { this.props.episode_id && actions.site.loadEpisode() } render() { if (this.props.logged_in) { return this.props.children } return ( ) } }