diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-09 21:20:03 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-09 21:20:03 +0100 |
| commit | 554695be3d2c0ed122fa83b6b0ac76e338116268 (patch) | |
| tree | 80facb1f97e3c345d6133c788587210083e84e3b /animism-align/frontend/app/views/editor/editor.gate.js | |
| parent | eeffc71a1eec3e80f1a1e1147ef1e5581c721c3e (diff) | |
making overview load
Diffstat (limited to 'animism-align/frontend/app/views/editor/editor.gate.js')
| -rw-r--r-- | animism-align/frontend/app/views/editor/editor.gate.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/animism-align/frontend/app/views/editor/editor.gate.js b/animism-align/frontend/app/views/editor/editor.gate.js index b835a69..5076350 100644 --- a/animism-align/frontend/app/views/editor/editor.gate.js +++ b/animism-align/frontend/app/views/editor/editor.gate.js @@ -18,32 +18,37 @@ class EditorGate extends Component { componentDidUpdate(prevProps) { if ( this.props.episode_id !== prevProps.episode_id || - this.props.episode.lookup !== prevProps.episode.lookup + this.props.episode.lookup !== prevProps.episode.lookup || + this.props.project.lookup !== prevProps.project.lookup ) { this.load() } } load() { + if (!this.props.project.lookup) return if (!this.props.episode.lookup) return if (!this.props.episode_id) return + if (parseInt(this.props.episode_id) === parseInt(this.props.current_episode_id)) return const episode = this.props.episode.lookup[this.props.episode_id] - actions.site.loadEpisode(episode) + const project = this.props.project.lookup[episode.project_id] + actions.site.loadEpisode(project, episode) } render() { - if (parseInt(this.props.episode_id) === parseInt(this.props.currentEpisodeId)) { + if (parseInt(this.props.episode_id) === parseInt(this.props.current_episode_id)) { return this.props.children } return ( - <div className="dashboard"><Loader /></div> + <div className="overview"><Loader /></div> ) } } const mapStateToProps = state => ({ episode: state.episode.index, - currentEpisodeId: state.align.currentEpisodeId, + project: state.project.index, + current_episode_id: state.site.episode.id, }) export default connect(mapStateToProps)(EditorGate)
\ No newline at end of file |
