Oops: the file modifications for making it log in.

This commit is contained in:
David Baker 2015-06-11 18:25:29 +01:00
parent a3126477bd
commit add78c6e92
6 changed files with 147 additions and 24 deletions

View file

@ -5,11 +5,30 @@ var MessageSection = require('../organisms/MessageSection');
var Login = require('../templates/Login');
var mxCli = require("../MatrixClientPeg").get();
var mxCliPeg = require("../MatrixClientPeg");
var dis = require("../dispatcher");
module.exports = React.createClass({
getInitialState: function() {
return {
logged_in: false
};
},
componentWillMount: function() {
var that = this;
this.dispatcherRef = dis.register(function(payload) {
switch(payload.action) {
case 'logged_in':
that.setState({logged_in: true});
break;
}
});
},
render: function() {
if (mxCli && mxCli.credentials) {
if (this.state.logged_in) {
return (
<div>
<ThreadSection />