Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1294 from matrix-org/revert-1290-luke/fix-user-ur…
Browse files Browse the repository at this point in the history
…l-no-middle-panel

Revert "At /user, view member of current room"
  • Loading branch information
lukebarnard1 committed Aug 14, 2017
2 parents 1ce433b + 2844b57 commit e48c491
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ module.exports = React.createClass({
});
}, 0);
}
this.notifyNewScreen('user/' + payload.member.userId);
break;
case 'view_room':
// Takes either a room ID or room alias: if switching to a room the client is already
Expand Down Expand Up @@ -1214,29 +1213,9 @@ module.exports = React.createClass({
return;
}

// Get the member object for the current room, if a current room is set or
// we have a last_room in localStorage. The user might not be a member of
// this room (in which case member will be falsey).
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);
}
this._setPage(PageTypes.UserView);
this.notifyNewScreen('user/' + userId);
const member = new Matrix.RoomMember(null, userId);
dis.dispatch({
action: 'view_user',
member: member,
Expand Down

0 comments on commit e48c491

Please sign in to comment.