Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
ce2d595195
1 changed files with 10 additions and 1 deletions
|
@ -570,6 +570,15 @@ module.exports = React.createClass({
|
||||||
const allRooms = RoomListSorter.mostRecentActivityFirst(
|
const allRooms = RoomListSorter.mostRecentActivityFirst(
|
||||||
MatrixClientPeg.get().getRooms(),
|
MatrixClientPeg.get().getRooms(),
|
||||||
);
|
);
|
||||||
|
// If there are 0 rooms or 1 room, view the home page because otherwise
|
||||||
|
// if there are 0, we end up trying to index into an empty array, and
|
||||||
|
// if there is 1, we end up viewing the same room.
|
||||||
|
if (allRooms.length < 2) {
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'view_home_page',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
let roomIndex = -1;
|
let roomIndex = -1;
|
||||||
for (let i = 0; i < allRooms.length; ++i) {
|
for (let i = 0; i < allRooms.length; ++i) {
|
||||||
if (allRooms[i].roomId == this.state.currentRoomId) {
|
if (allRooms[i].roomId == this.state.currentRoomId) {
|
||||||
|
@ -1307,7 +1316,7 @@ module.exports = React.createClass({
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_room_directory',
|
action: 'view_home_page',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue