mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-18 06:35:35 +08:00
Merge pull request #929 from matrix-org/luke/new-guest-access-fix-view-next-room
Fix view_next_room, view_previous_room and view_indexed_room
This commit is contained in:
commit
1c7785535f
@ -554,6 +554,7 @@ module.exports = React.createClass({
|
|||||||
this.notifyNewScreen('register');
|
this.notifyNewScreen('register');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: Move to RoomViewStore
|
||||||
_viewNextRoom: function(roomIndexDelta) {
|
_viewNextRoom: function(roomIndexDelta) {
|
||||||
const allRooms = RoomListSorter.mostRecentActivityFirst(
|
const allRooms = RoomListSorter.mostRecentActivityFirst(
|
||||||
MatrixClientPeg.get().getRooms(),
|
MatrixClientPeg.get().getRooms(),
|
||||||
@ -567,15 +568,22 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
roomIndex = (roomIndex + roomIndexDelta) % allRooms.length;
|
roomIndex = (roomIndex + roomIndexDelta) % allRooms.length;
|
||||||
if (roomIndex < 0) roomIndex = allRooms.length - 1;
|
if (roomIndex < 0) roomIndex = allRooms.length - 1;
|
||||||
this._viewRoom({ room_id: allRooms[roomIndex].roomId });
|
dis.dispatch({
|
||||||
|
action: 'view_room',
|
||||||
|
room_id: allRooms[roomIndex].roomId,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: Move to RoomViewStore
|
||||||
_viewIndexedRoom: function(roomIndex) {
|
_viewIndexedRoom: function(roomIndex) {
|
||||||
const allRooms = RoomListSorter.mostRecentActivityFirst(
|
const allRooms = RoomListSorter.mostRecentActivityFirst(
|
||||||
MatrixClientPeg.get().getRooms(),
|
MatrixClientPeg.get().getRooms(),
|
||||||
);
|
);
|
||||||
if (allRooms[roomIndex]) {
|
if (allRooms[roomIndex]) {
|
||||||
this._viewRoom({ room_id: allRooms[roomIndex].roomId });
|
dis.dispatch({
|
||||||
|
action: 'view_room',
|
||||||
|
room_id: allRooms[roomIndex].roomId,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user