mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Goto /home when forgetting the last room
This commit is contained in:
parent
f680bb5d3c
commit
c7229967a6
1 changed files with 6 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue