mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:35:04 +08:00
Change to componentDidUpdate
to process first reaction
This changes to "did update" and also calls the reaction change handler to ensure that we update the state of my reactions (to know which were sent by you).
This commit is contained in:
parent
dc4fccd291
commit
33513a95d7
@ -41,10 +41,11 @@ export default class ReactionDimension extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentDidUpdate(prevProps) {
|
||||||
if (this.props.reactions !== nextProps.reactions) {
|
if (prevProps.reactions !== this.props.reactions) {
|
||||||
nextProps.reactions.on("Relations.add", this.onReactionsChange);
|
this.props.reactions.on("Relations.add", this.onReactionsChange);
|
||||||
nextProps.reactions.on("Relations.redaction", this.onReactionsChange);
|
this.props.reactions.on("Relations.redaction", this.onReactionsChange);
|
||||||
|
this.onReactionsChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,10 +42,11 @@ export default class ReactionsRow extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentDidUpdate(prevProps) {
|
||||||
if (this.props.reactions !== nextProps.reactions) {
|
if (prevProps.reactions !== this.props.reactions) {
|
||||||
nextProps.reactions.on("Relations.add", this.onReactionsChange);
|
this.props.reactions.on("Relations.add", this.onReactionsChange);
|
||||||
nextProps.reactions.on("Relations.redaction", this.onReactionsChange);
|
this.props.reactions.on("Relations.redaction", this.onReactionsChange);
|
||||||
|
this.onReactionsChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user