diff --git a/src/components/views/messages/ReactionDimension.js b/src/components/views/messages/ReactionDimension.js index f7b43a418c..13d43804ac 100644 --- a/src/components/views/messages/ReactionDimension.js +++ b/src/components/views/messages/ReactionDimension.js @@ -37,18 +37,24 @@ export default class ReactionDimension extends React.PureComponent { }; if (props.reactions) { + props.reactions.on("Relations.add", this.onReactionsChange); props.reactions.on("Relations.redaction", this.onReactionsChange); } } componentWillReceiveProps(nextProps) { if (this.props.reactions !== nextProps.reactions) { + nextProps.reactions.on("Relations.add", this.onReactionsChange); nextProps.reactions.on("Relations.redaction", this.onReactionsChange); } } componentWillUnmount() { if (this.props.reactions) { + this.props.reactions.removeListener( + "Relations.add", + this.onReactionsChange, + ); this.props.reactions.removeListener( "Relations.redaction", this.onReactionsChange, diff --git a/src/components/views/messages/ReactionsRow.js b/src/components/views/messages/ReactionsRow.js index a58990a8a5..c49f5cba75 100644 --- a/src/components/views/messages/ReactionsRow.js +++ b/src/components/views/messages/ReactionsRow.js @@ -32,18 +32,24 @@ export default class ReactionsRow extends React.PureComponent { super(props); if (props.reactions) { + props.reactions.on("Relations.add", this.onReactionsChange); props.reactions.on("Relations.redaction", this.onReactionsChange); } } componentWillReceiveProps(nextProps) { if (this.props.reactions !== nextProps.reactions) { + nextProps.reactions.on("Relations.add", this.onReactionsChange); nextProps.reactions.on("Relations.redaction", this.onReactionsChange); } } componentWillUnmount() { if (this.props.reactions) { + this.props.reactions.removeListener( + "Relations.add", + this.onReactionsChange, + ); this.props.reactions.removeListener( "Relations.redaction", this.onReactionsChange,