From 8370fa8bb4485e7ac857fc045ebc09b3d864a3bb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 26 May 2020 19:56:56 -0600 Subject: [PATCH] Event.decrypted from the client --- src/components/views/rooms/RoomTile2.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomTile2.tsx b/src/components/views/rooms/RoomTile2.tsx index 47ce001983..c95cd108dc 100644 --- a/src/components/views/rooms/RoomTile2.tsx +++ b/src/components/views/rooms/RoomTile2.tsx @@ -91,17 +91,19 @@ export default class RoomTile2 extends React.Component { this.props.room.on("Room.receipt", 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); + MatrixClientPeg.get().on("Event.decrypted", this.handleRoomEventUpdate); } public componentWillUnmount() { if (this.props.room) { this.props.room.removeListener("Room.receipt", 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); } + 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