Fix un-marking rooms as DM rooms

This commit is contained in:
David Baker 2016-09-13 11:06:07 +01:00
parent ce40fa1a8f
commit d19686b96d

View file

@ -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);