From 46bfedc506aa98ed130a171fe4149d8f168f6ab9 Mon Sep 17 00:00:00 2001 From: Vladimir Polyakov Date: Sat, 11 Jul 2015 21:31:23 +0300 Subject: [PATCH] fix route change issue --- static/js/app/components/builds/view.js | 7 +++++-- static/js/app/components/projects/view/index.js | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/static/js/app/components/builds/view.js b/static/js/app/components/builds/view.js index ada5635..708e3f1 100644 --- a/static/js/app/components/builds/view.js +++ b/static/js/app/components/builds/view.js @@ -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) { diff --git a/static/js/app/components/projects/view/index.js b/static/js/app/components/projects/view/index.js index a3fe47a..cd05bb3 100644 --- a/static/js/app/components/projects/view/index.js +++ b/static/js/app/components/projects/view/index.js @@ -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) {