Event.decrypted from the client

This commit is contained in:
Travis Ralston 2020-05-26 19:56:56 -06:00
parent bf8a3d4419
commit 8370fa8bb4

View file

@ -91,17 +91,19 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
this.props.room.on("Room.receipt", this.handleRoomEventUpdate); this.props.room.on("Room.receipt", this.handleRoomEventUpdate);
this.props.room.on("Room.timeline", this.handleRoomEventUpdate); this.props.room.on("Room.timeline", this.handleRoomEventUpdate);
this.props.room.on("Event.decrypted", this.handleRoomEventUpdate);
this.props.room.on("Room.redaction", this.handleRoomEventUpdate); this.props.room.on("Room.redaction", this.handleRoomEventUpdate);
MatrixClientPeg.get().on("Event.decrypted", this.handleRoomEventUpdate);
} }
public componentWillUnmount() { public componentWillUnmount() {
if (this.props.room) { if (this.props.room) {
this.props.room.removeListener("Room.receipt", this.handleRoomEventUpdate); this.props.room.removeListener("Room.receipt", this.handleRoomEventUpdate);
this.props.room.removeListener("Room.timeline", this.handleRoomEventUpdate); this.props.room.removeListener("Room.timeline", this.handleRoomEventUpdate);
this.props.room.removeListener("Event.decrypted", this.handleRoomEventUpdate);
this.props.room.removeListener("Room.redaction", this.handleRoomEventUpdate); this.props.room.removeListener("Room.redaction", this.handleRoomEventUpdate);
} }
if (MatrixClientPeg.get()) {
MatrixClientPeg.get().removeListener("Event.decrypted", this.handleRoomEventUpdate);
}
} }
// XXX: This is a bit of an awful-looking hack. We should probably be using state for // XXX: This is a bit of an awful-looking hack. We should probably be using state for