mirror of https://github.com/vector-im/riot-web
Merge pull request #4177 from matrix-org/travis/no-rooms-dm
Fix not being able to start chats when you have no roomspull/21833/head
commit
d3439c8101
|
@ -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 New Issue