mirror of https://github.com/vector-im/riot-web
Switch to another room when we succesfully leave a room
parent
5835ea0a97
commit
6bfc566d9a
|
@ -42,20 +42,6 @@ module.exports = React.createClass({
|
|||
this.setState({ 'hover': false });
|
||||
},
|
||||
|
||||
onLeaveClick: function() {
|
||||
var d = MatrixClientPeg.get().leave(this.props.member.roomId);
|
||||
// TODO: Add spinner
|
||||
|
||||
d.then(function() {
|
||||
// TODO: Change to another room.
|
||||
}, function(err) {
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to leave room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var isMyUser = MatrixClientPeg.get().credentials.userId == this.props.member.userId;
|
||||
|
||||
|
|
|
@ -27,4 +27,19 @@ module.exports = {
|
|||
user_id: this.props.member.userId
|
||||
});
|
||||
},
|
||||
|
||||
onLeaveClick: function() {
|
||||
var d = MatrixClientPeg.get().leave(this.props.member.roomId);
|
||||
// TODO: Add spinner
|
||||
|
||||
d.then(function() {
|
||||
// TODO: Change to another room.
|
||||
dis.dispatch({action: 'view_next_room'});
|
||||
}, function(err) {
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to leave room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -122,4 +122,3 @@ module.exports = {
|
|||
});
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue