Commit 5bbb2e52 authored by Jean-Marc Le Roux's avatar Jean-Marc Le Roux

Fix amendment => articles tab switch.

parent fc638fc0
Pipeline #42193 passed with stages
in 2 minutes and 10 seconds
......@@ -10,6 +10,16 @@ import {
} from '../action/article';
class ArticleList extends Component {
componentWillMount() {
const { dispatch, project, selectedAmendment } = this.props;
if (!project) {
return ;
}
dispatch(fetchArticlesIfNeeded(project, selectedAmendment));
}
componentDidUpdate() {
const { dispatch, project, selectedAmendment } = this.props;
......@@ -17,14 +27,12 @@ class ArticleList extends Component {
return ;
}
// FIXME: hardcoded ref to "master"
dispatch(fetchArticlesIfNeeded(project, selectedAmendment));
}
handleArticleClick(article) {
const { dispatch, project, selectedAmendment } = this.props;
// FIXME: hardcoded ref to "master"
dispatch(fetchArticleContentIfNeeded(project, selectedAmendment, article.id));
}
......
......@@ -30,11 +30,8 @@ class Project extends Component {
componentWillMount() {
const { dispatch, match, selectedProject } = this.props;
if (!!match.params.selectedProject && !selectedProject) {
if (!!match.params.selectedProject && !selectedProject)
dispatch(selectProject(parseInt(match.params.selectedProject)));
} else {
dispatch(fetchArticlesIfNeeded(selectedProject));
}
this.setTabByName(match.params.tab);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment