forked from mystiq/hydrogen-web
don't assume roomKeys is an array
This commit is contained in:
parent
4c1aaaf416
commit
4a2faed198
1 changed files with 6 additions and 4 deletions
|
@ -60,10 +60,12 @@ export class DeviceMessageHandler {
|
|||
}
|
||||
|
||||
_applyDecryptChanges(rooms, {roomKeys}) {
|
||||
const roomKeysByRoom = groupBy(roomKeys, s => s.roomId);
|
||||
for (const [roomId, roomKeys] of roomKeysByRoom) {
|
||||
const room = rooms.get(roomId);
|
||||
room?.notifyRoomKeys(roomKeys);
|
||||
if (roomKeys && roomKeys.length) {
|
||||
const roomKeysByRoom = groupBy(roomKeys, s => s.roomId);
|
||||
for (const [roomId, roomKeys] of roomKeysByRoom) {
|
||||
const room = rooms.get(roomId);
|
||||
room?.notifyRoomKeys(roomKeys);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue