|
|
|
@ -2,8 +2,6 @@
|
|
|
|
|
const React = require('react');
|
|
|
|
|
const ReactDOM = require('react-dom');
|
|
|
|
|
const create = require('create-react-class');
|
|
|
|
|
const Promise = require('bluebird');
|
|
|
|
|
const urllib = require('url');
|
|
|
|
|
const sdk = require('matrix-js-sdk');
|
|
|
|
|
|
|
|
|
|
const Sidebar = require('./components/sidebar.js');
|
|
|
|
@ -60,8 +58,9 @@ let App = create({
|
|
|
|
|
|
|
|
|
|
startClient: function(client) {
|
|
|
|
|
console.log(client);
|
|
|
|
|
client.on("sync", (state, prevState, data) => {
|
|
|
|
|
client.on("sync", (state, _prevState, _data) => {
|
|
|
|
|
if (state == "ERROR") {
|
|
|
|
|
/* FIXME: Implement? */
|
|
|
|
|
} else if (state == "SYNCING") {
|
|
|
|
|
let rooms = {};
|
|
|
|
|
client.getRooms().forEach((room) => {
|
|
|
|
@ -69,15 +68,18 @@ let App = create({
|
|
|
|
|
});
|
|
|
|
|
this.setState({rooms: rooms});
|
|
|
|
|
} else if (state == "PREPARED") {
|
|
|
|
|
/* FIXME: Implement? */
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
client.on("Room.localEchoUpdated", (event) => {
|
|
|
|
|
|
|
|
|
|
client.on("Room.localEchoUpdated", (_event) => {
|
|
|
|
|
let rooms = {};
|
|
|
|
|
client.getRooms().forEach((room) => {
|
|
|
|
|
rooms[room.roomId] = room;
|
|
|
|
|
});
|
|
|
|
|
this.setState({rooms: rooms});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
client.startClient();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|