mirror of https://github.com/vector-im/riot-web
Merge pull request #465 from matrix-org/dbkr/fix_unset_dm
Fix un-marking rooms as DM roomspull/21833/head
commit
ed2595e300
10
src/Rooms.js
10
src/Rooms.js
|
@ -107,11 +107,13 @@ export function setDMRoom(roomId, userId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// now add it, if it's not already there
|
// now add it, if it's not already there
|
||||||
const roomList = dmRoomMap[userId] || [];
|
if (userId) {
|
||||||
if (roomList.indexOf(roomId) == -1) {
|
const roomList = dmRoomMap[userId] || [];
|
||||||
roomList.push(roomId);
|
if (roomList.indexOf(roomId) == -1) {
|
||||||
|
roomList.push(roomId);
|
||||||
|
}
|
||||||
|
dmRoomMap[userId] = roomList;
|
||||||
}
|
}
|
||||||
dmRoomMap[userId] = roomList;
|
|
||||||
|
|
||||||
|
|
||||||
return MatrixClientPeg.get().setAccountData('m.direct', dmRoomMap);
|
return MatrixClientPeg.get().setAccountData('m.direct', dmRoomMap);
|
||||||
|
|
Loading…
Reference in New Issue