1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-18 09:22:18 +03:00

Goto /home when forgetting the last room

This commit is contained in:
Luke Barnard
2017-06-09 10:28:45 +01:00
parent f680bb5d3c
commit c7229967a6

View File

@ -570,6 +570,12 @@ module.exports = React.createClass({
const allRooms = RoomListSorter.mostRecentActivityFirst(
MatrixClientPeg.get().getRooms(),
);
if (allRooms.length === 0) {
dis.dispatch({
action: 'view_home_page',
});
return;
}
let roomIndex = -1;
for (let i = 0; i < allRooms.length; ++i) {
if (allRooms[i].roomId == this.state.currentRoomId) {