mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
dont error on rooms the user has left already
This commit is contained in:
parent
d16ac4d80c
commit
3992e99850
1 changed files with 2 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue