mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
dont error on rooms the user has left already
This commit is contained in:
parent
d16ac4d80c
commit
3992e99850
@ -191,14 +191,11 @@ function _showAnyInviteErrors(addrs, room) {
|
|||||||
function _getDirectMessageRooms(addr) {
|
function _getDirectMessageRooms(addr) {
|
||||||
const dmRoomMap = new DMRoomMap(MatrixClientPeg.get());
|
const dmRoomMap = new DMRoomMap(MatrixClientPeg.get());
|
||||||
const dmRooms = dmRoomMap.getDMRoomsForUserId(addr);
|
const dmRooms = dmRoomMap.getDMRoomsForUserId(addr);
|
||||||
const rooms = [];
|
const rooms = dmRooms.filter((dmRoom) => {
|
||||||
dmRooms.forEach((dmRoom) => {
|
|
||||||
const room = MatrixClientPeg.get().getRoom(dmRoom);
|
const room = MatrixClientPeg.get().getRoom(dmRoom);
|
||||||
if (room) {
|
if (room) {
|
||||||
const me = room.getMember(MatrixClientPeg.get().credentials.userId);
|
const me = room.getMember(MatrixClientPeg.get().credentials.userId);
|
||||||
if (me.membership == 'join') {
|
return me && me.membership == 'join';
|
||||||
rooms.push(room);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return rooms;
|
return rooms;
|
||||||
|
Loading…
Reference in New Issue
Block a user