mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 01:35:49 +03:00
Allow component to update if currently expanded or if about to collapse
This commit is contained in:
parent
e7564f4dc5
commit
55f85befc1
1 changed files with 5 additions and 1 deletions
|
@ -145,9 +145,13 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
shouldComponentUpdate: function(nextProps, nextState) {
|
||||
// Update if
|
||||
// - The number of summarised events has changed
|
||||
// - or if the summary is currently expanded
|
||||
// - or if the summary is about to toggle to become collapsed
|
||||
return (
|
||||
nextProps.events.length !== this.props.events.length ||
|
||||
nextState.expanded !== this.state.expanded
|
||||
this.state.expanded || nextState.expanded
|
||||
);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue