fix route change issue

This commit is contained in:
Vladimir Polyakov 2015-07-11 21:31:23 +03:00
parent 94d57445b3
commit 46bfedc506
2 changed files with 11 additions and 5 deletions

View File

@ -22,9 +22,12 @@ define([
var Component = React.createClass({
mixins: [Reflux.ListenerMixin],
statics: {
willTransitionTo: function(transition, params, query) {
BuildActions.read(Number(params.id));
}
},
componentDidMount: function() {
BuildActions.read(Number(this.props.params.id));
this.listenTo(buildStore, this.updateBuild);
},
updateBuild: function(build) {

View File

@ -18,10 +18,13 @@ define([
return React.createClass({
mixins: [Reflux.ListenerMixin],
statics: {
willTransitionTo: function(transition, params, query) {
ProjectActions.read({name: params.name});
BuildActions.readAll({projectName: params.name});
}
},
componentDidMount: function() {
ProjectActions.read({name: this.props.params.name});
BuildActions.readAll({projectName: this.props.params.name});
this.listenTo(projectStore, this.updateItem);
},
updateItem: function(project) {