Merge pull request #4177 from matrix-org/travis/no-rooms-dm
Fix not being able to start chats when you have no rooms
This commit is contained in:
commit
d3439c8101
1 changed files with 1 additions and 0 deletions
|
@ -168,6 +168,7 @@ export default class DMRoomMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
getUniqueRoomsWithIndividuals(): {[userId: string]: Room} {
|
getUniqueRoomsWithIndividuals(): {[userId: string]: Room} {
|
||||||
|
if (!this.roomToUser) return {}; // No rooms means no map.
|
||||||
return Object.keys(this.roomToUser)
|
return Object.keys(this.roomToUser)
|
||||||
.map(r => ({userId: this.getUserIdForRoomId(r), room: this.matrixClient.getRoom(r)}))
|
.map(r => ({userId: this.getUserIdForRoomId(r), room: this.matrixClient.getRoom(r)}))
|
||||||
.filter(r => r.userId && r.room && r.room.getInvitedAndJoinedMemberCount() === 2)
|
.filter(r => r.userId && r.room && r.room.getInvitedAndJoinedMemberCount() === 2)
|
||||||
|
|
Loading…
Reference in a new issue