mirror of https://github.com/vector-im/riot-web
Fix logout
parent
1dbc54e172
commit
e2348c50d5
|
@ -17,7 +17,9 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
if (MatrixClientPeg.get()) {
|
||||||
|
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillReceiveProps: function(props) {
|
componentWillReceiveProps: function(props) {
|
||||||
|
|
|
@ -33,11 +33,12 @@ module.exports = React.createClass({
|
||||||
onAction: function(payload) {
|
onAction: function(payload) {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'logout':
|
case 'logout':
|
||||||
mxCliPeg.replace(null);
|
|
||||||
this.setState({
|
this.setState({
|
||||||
logged_in: false,
|
logged_in: false,
|
||||||
ready: false
|
ready: false
|
||||||
});
|
});
|
||||||
|
mxCliPeg.get().removeAllListeners();
|
||||||
|
mxCliPeg.replace(null);
|
||||||
break;
|
break;
|
||||||
case 'view_room':
|
case 'view_room':
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Reference in New Issue