Set scrolldown flag on tab changes in willUpdate instead of receiveProps

This commit is contained in:
Ken-Håvard Lieng 2017-03-30 04:37:55 +02:00
parent 80efb750f9
commit 6a9942a655
2 changed files with 20 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,13 +8,11 @@ const scrollBarWidth = measureScrollBarWidth();
const listStyle = { padding: '7px 0', boxSizing: 'content-box' }; const listStyle = { padding: '7px 0', boxSizing: 'content-box' };
export default class MessageBox extends PureComponent { export default class MessageBox extends PureComponent {
componentWillReceiveProps(nextProps) { componentWillUpdate(nextProps) {
if (nextProps.tab !== this.props.tab) { if (nextProps.tab !== this.props.tab) {
this.bottom = true; this.bottom = true;
} }
}
componentWillUpdate(nextProps) {
if (nextProps.messages !== this.props.messages) { if (nextProps.messages !== this.props.messages) {
this.list.recomputeRowHeights(); this.list.recomputeRowHeights();
} }