Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
dont error on rooms the user has left already
Browse files Browse the repository at this point in the history
  • Loading branch information
bwindels committed Jul 23, 2018
1 parent d16ac4d commit 3992e99
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/RoomInvite.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,11 @@ function _showAnyInviteErrors(addrs, room) {
function _getDirectMessageRooms(addr) {
const dmRoomMap = new DMRoomMap(MatrixClientPeg.get());
const dmRooms = dmRoomMap.getDMRoomsForUserId(addr);
const rooms = [];
dmRooms.forEach((dmRoom) => {
const rooms = dmRooms.filter((dmRoom) => {
const room = MatrixClientPeg.get().getRoom(dmRoom);
if (room) {
const me = room.getMember(MatrixClientPeg.get().credentials.userId);
if (me.membership == 'join') {
rooms.push(room);
}
return me && me.membership == 'join';
}
});
return rooms;
Expand Down

0 comments on commit 3992e99

Please sign in to comment.