You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03: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:
@@ -41,10 +41,11 @@ export default class ReactionDimension extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.reactions !== nextProps.reactions) {
|
||||
nextProps.reactions.on("Relations.add", this.onReactionsChange);
|
||||
nextProps.reactions.on("Relations.redaction", this.onReactionsChange);
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.reactions !== this.props.reactions) {
|
||||
this.props.reactions.on("Relations.add", 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) {
|
||||
if (this.props.reactions !== nextProps.reactions) {
|
||||
nextProps.reactions.on("Relations.add", this.onReactionsChange);
|
||||
nextProps.reactions.on("Relations.redaction", this.onReactionsChange);
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.reactions !== this.props.reactions) {
|
||||
this.props.reactions.on("Relations.add", this.onReactionsChange);
|
||||
this.props.reactions.on("Relations.redaction", this.onReactionsChange);
|
||||
this.onReactionsChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user