Skip to content

Commit

Permalink
fix issue przeor#8 Login.attemptedTransition assigned but never used
Browse files Browse the repository at this point in the history
  • Loading branch information
greenlaw110 committed Jul 29, 2015
1 parent 2a6d978 commit f02f05d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/js/components/app-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ var Template =
<div className="container">
<Header />
{this.props.children}
<br/><br/>
{ /* this button component uses view action dispatcher api and it is using flux architecture */ }
<button className="btn btn-default" onClick={this.handleClick}>Add Item (an example output in the console .. it is using Actions-&lt;Dispatcher-&lt;Store one directional flow) </button>
</div>
)
}
Expand Down
13 changes: 1 addition & 12 deletions src/js/components/app.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var RouteHandler = Router.RouteHandler;
var Login = require('./auth/app-login');
var AppActions = require('../actions/app-actions.js');
var AppStore = require('../stores/app-store.js');
var RouteHandler = require('react-router').RouteHandler;
var Entity = require('./app-entity');
var Link = Router.Link;

var Template = require('./app-template');



var APP = React.createClass({
render: function () {
return (
<Template>
<RouteHandler/>
{ /* this Entity component uses view request dispatcher for web api call and it is using flux architecture */ }
<Entity />
</Template>
);
}
Expand Down
7 changes: 5 additions & 2 deletions src/js/components/auth/app-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ var Login = React.createClass({

getInitialState: function () {
return AuthStore.getState();

},
componentDidMount: function() {
AuthStore.addChangeListener(this._onChange);
},
componentDidUpdate: function() {
if(this.state.auth_token!==null) {
this.context.router.replaceWith('/dashboard');
if(Login.attemptedTransition) {
Login.attemptedTransition.retry();
} else {
this.context.router.replaceWith('/dashboard');
}
}
},
componentWillUnmount: function() {
Expand Down

0 comments on commit f02f05d

Please sign in to comment.