mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Tune types in ReactionsRow
This commit is contained in:
parent
d4ca1babbe
commit
7d59d5cb39
1 changed files with 4 additions and 4 deletions
|
@ -113,7 +113,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps: IProps) {
|
||||||
if (prevProps.reactions !== this.props.reactions) {
|
if (prevProps.reactions !== this.props.reactions) {
|
||||||
this.props.reactions.on("Relations.add", this.onReactionsChange);
|
this.props.reactions.on("Relations.add", this.onReactionsChange);
|
||||||
this.props.reactions.on("Relations.remove", this.onReactionsChange);
|
this.props.reactions.on("Relations.remove", this.onReactionsChange);
|
||||||
|
@ -127,7 +127,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
onReactionsChange = () => {
|
private onReactionsChange = () => {
|
||||||
// TODO: Call `onHeightChanged` as needed
|
// TODO: Call `onHeightChanged` as needed
|
||||||
this.setState({
|
this.setState({
|
||||||
myReactions: this.getMyReactions(),
|
myReactions: this.getMyReactions(),
|
||||||
|
@ -138,7 +138,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
getMyReactions() {
|
private getMyReactions() {
|
||||||
const reactions = this.props.reactions;
|
const reactions = this.props.reactions;
|
||||||
if (!reactions) {
|
if (!reactions) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -151,7 +151,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
|
||||||
return [...myReactions.values()];
|
return [...myReactions.values()];
|
||||||
}
|
}
|
||||||
|
|
||||||
onShowAllClick = () => {
|
private onShowAllClick = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
showAll: true,
|
showAll: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue