Skip to content

Commit 6bfc566

Browse files
committed
Switch to another room when we succesfully leave a room
1 parent 5835ea0 commit 6bfc566

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎skins/base/views/molecules/MemberTile.js‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@ module.exports = React.createClass({
4242
this.setState({ 'hover': false });
4343
},
4444

45-
onLeaveClick: function() {
46-
var d = MatrixClientPeg.get().leave(this.props.member.roomId);
47-
// TODO: Add spinner
48-
49-
d.then(function() {
50-
// TODO: Change to another room.
51-
}, function(err) {
52-
Modal.createDialog(ErrorDialog, {
53-
title: "Failed to leave room",
54-
description: err.toString()
55-
});
56-
});
57-
},
58-
5945
render: function() {
6046
var isMyUser = MatrixClientPeg.get().credentials.userId == this.props.member.userId;
6147

‎src/controllers/molecules/MemberTile.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,19 @@ module.exports = {
2727
user_id: this.props.member.userId
2828
});
2929
},
30+
31+
onLeaveClick: function() {
32+
var d = MatrixClientPeg.get().leave(this.props.member.roomId);
33+
// TODO: Add spinner
34+
35+
d.then(function() {
36+
// TODO: Change to another room.
37+
dis.dispatch({action: 'view_next_room'});
38+
}, function(err) {
39+
Modal.createDialog(ErrorDialog, {
40+
title: "Failed to leave room",
41+
description: err.toString()
42+
});
43+
});
44+
}
3045
};

‎src/controllers/organisms/RoomList.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,3 @@ module.exports = {
122122
});
123123
},
124124
};
125-

0 commit comments

Comments
 (0)