Merge that good fresh upstream shit

This commit is contained in:
beatrix-bitrot
2017-07-22 01:16:53 +00:00
21 changed files with 253 additions and 23 deletions

View File

@@ -45,6 +45,7 @@ const mapStateToProps = state => ({
systemFontUi: state.getIn(['meta', 'system_font_ui']),
layout: state.getIn(['local_settings', 'layout']),
isWide: state.getIn(['local_settings', 'stretch']),
isComposing: state.getIn(['compose', 'is_composing']),
});
@connect(mapStateToProps)
@@ -56,6 +57,7 @@ export default class UI extends React.PureComponent {
layout: PropTypes.string,
isWide: PropTypes.bool,
systemFontUi: PropTypes.bool,
isComposing: PropTypes.bool,
};
state = {
@@ -137,6 +139,19 @@ export default class UI extends React.PureComponent {
this.props.dispatch(refreshNotifications());
}
shouldComponentUpdate (nextProps) {
if (nextProps.isComposing !== this.props.isComposing) {
// Avoid expensive update just to toggle a class
this.node.classList.toggle('is-composing', nextProps.isComposing);
return false;
}
// Why isn't this working?!?
// return super.shouldComponentUpdate(nextProps, nextState);
return true;
}
componentWillUnmount () {
window.removeEventListener('resize', this.handleResize);
document.removeEventListener('dragenter', this.handleDragEnter);