Browse Source

Fix logout

pull/1/head
David Baker 7 years ago
parent
commit
e2348c50d5
  1. 4
      src/organisms/RoomView.js
  2. 3
      src/pages/MatrixChat.js

4
src/organisms/RoomView.js

@ -17,7 +17,9 @@ module.exports = React.createClass({
},
componentWillUnmount: function() {
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
if (MatrixClientPeg.get()) {
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
}
},
componentWillReceiveProps: function(props) {

3
src/pages/MatrixChat.js

@ -33,11 +33,12 @@ module.exports = React.createClass({
onAction: function(payload) {
switch (payload.action) {
case 'logout':
mxCliPeg.replace(null);
this.setState({
logged_in: false,
ready: false
});
mxCliPeg.get().removeAllListeners();
mxCliPeg.replace(null);
break;
case 'view_room':
this.setState({

Loading…
Cancel
Save