Merge pull request #1294 from matrix-org/revert-1290-luke/fix-user-url-no-middle-panel

Revert "At /user, view member of current room"
pull/21833/head
Luke Barnard 2017-08-14 16:31:24 +01:00 committed by GitHub
commit e48c4911b8
1 changed files with 3 additions and 24 deletions

View File

@ -448,7 +448,6 @@ module.exports = React.createClass({
}); });
}, 0); }, 0);
} }
this.notifyNewScreen('user/' + payload.member.userId);
break; break;
case 'view_room': case 'view_room':
// Takes either a room ID or room alias: if switching to a room the client is already // Takes either a room ID or room alias: if switching to a room the client is already
@ -1214,29 +1213,9 @@ module.exports = React.createClass({
return; return;
} }
// Get the member object for the current room, if a current room is set or this._setPage(PageTypes.UserView);
// we have a last_room in localStorage. The user might not be a member of this.notifyNewScreen('user/' + userId);
// this room (in which case member will be falsey). const member = new Matrix.RoomMember(null, userId);
let member;
const roomId = this.state.currentRoomId || localStorage.getItem('mx_last_room_id');
if (roomId) {
const room = MatrixClientPeg.get().getRoom(roomId);
if (room) {
member = room.getMember(userId);
}
}
if (member) {
// This user is a member of this room, so view the room
dis.dispatch({
action: 'view_room',
room_id: roomId,
});
} else {
// This user is not a member of this room, show the user view
member = new Matrix.RoomMember(null, userId);
this._setPage(PageTypes.UserView);
}
dis.dispatch({ dis.dispatch({
action: 'view_user', action: 'view_user',
member: member, member: member,