forked from mystiq/hydrogen-web
create user id array in m.direct if it doesn't exist already
This commit is contained in:
parent
d2008a336b
commit
2765f48a64
1 changed files with 4 additions and 1 deletions
|
@ -236,7 +236,10 @@ export class RoomBeingCreated extends EventEmitter<{change: never}> {
|
||||||
mapEntry = {type: DM_MAP_TYPE, content: {}};
|
mapEntry = {type: DM_MAP_TYPE, content: {}};
|
||||||
}
|
}
|
||||||
const map = mapEntry.content;
|
const map = mapEntry.content;
|
||||||
const userRooms = map[userId];
|
let userRooms = map[userId];
|
||||||
|
if (!userRooms) {
|
||||||
|
map[userId] = userRooms = [];
|
||||||
|
}
|
||||||
// this is a new room id so no need to check if it's already there
|
// this is a new room id so no need to check if it's already there
|
||||||
userRooms.push(this._roomId);
|
userRooms.push(this._roomId);
|
||||||
txn.accountData.set(mapEntry);
|
txn.accountData.set(mapEntry);
|
||||||
|
|
Loading…
Reference in a new issue