memberChanges is a map, not array

This commit is contained in:
Bruno Windels 2020-09-08 14:23:38 +02:00
parent bbaf3a5605
commit 7b35a3c46c

View File

@ -45,8 +45,11 @@ export class RoomEncryption {
} }
async writeMemberChanges(memberChanges, txn) { async writeMemberChanges(memberChanges, txn) {
if (memberChanges.some(m => m.hasLeft)) { for (const m of memberChanges.values()) {
if (m.hasLeft) {
this._megolmEncryption.discardOutboundSession(this._room.id, txn); this._megolmEncryption.discardOutboundSession(this._room.id, txn);
break;
}
} }
return await this._deviceTracker.writeMemberChanges(this._room, memberChanges, txn); return await this._deviceTracker.writeMemberChanges(this._room, memberChanges, txn);
} }