mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Fix room account settings (#7999)
This commit is contained in:
parent
9379be0189
commit
3426c3c3cd
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user