Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix room account settings (#7999)
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans authored Mar 7, 2022
1 parent 9379be0 commit 3426c3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/settings/handlers/RoomAccountSettingsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ export default class RoomAccountSettingsHandler extends MatrixClientBackedSettin
if (field === null) {
content = value;
} else {
const content = this.getSettings(roomId, eventType) || {};
content = this.getSettings(roomId, eventType) || {};
content[field] = value;
}

await this.client.setRoomAccountData(roomId, eventType, content);

const deferred = defer<void>();
const handler = (event: MatrixEvent) => {
if (event.getRoomId() !== roomId || event.getType() !== eventType) return;
const handler = (event: MatrixEvent, room: Room) => {
if (room.roomId !== roomId || event.getType() !== eventType) return;
if (field !== null && event.getContent()[field] !== value) return;
this.client.off(RoomEvent.AccountData, handler);
deferred.resolve();
Expand Down

0 comments on commit 3426c3c

Please sign in to comment.