Oops: the file modifications for making it log in.
This commit is contained in:
parent
a3126477bd
commit
add78c6e92
6 changed files with 147 additions and 24 deletions
|
@ -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 />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue