Merge pull request #4177 from matrix-org/travis/no-rooms-dm

Fix not being able to start chats when you have no rooms
pull/21833/head
Travis Ralston 2020-03-04 15:35:27 -07:00 committed by GitHub
commit d3439c8101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -168,6 +168,7 @@ export default class DMRoomMap {
}
getUniqueRoomsWithIndividuals(): {[userId: string]: Room} {
if (!this.roomToUser) return {}; // No rooms means no map.
return Object.keys(this.roomToUser)
.map(r => ({userId: this.getUserIdForRoomId(r), room: this.matrixClient.getRoom(r)}))
.filter(r => r.userId && r.room && r.room.getInvitedAndJoinedMemberCount() === 2)