Merge remote-tracking branch 'upstream/master'
This commit is contained in:
		@@ -2,7 +2,7 @@ import React from 'react';
 | 
			
		||||
import ColumnHeader from './column_header';
 | 
			
		||||
import PropTypes from 'prop-types';
 | 
			
		||||
import { debounce } from 'lodash';
 | 
			
		||||
import scrollTop from '../../../scroll';
 | 
			
		||||
import { scrollTop } from '../../../scroll';
 | 
			
		||||
import { isMobile } from '../../../is_mobile';
 | 
			
		||||
 | 
			
		||||
export default class Column extends React.PureComponent {
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,8 @@ import ColumnLoading from './column_loading';
 | 
			
		||||
import BundleColumnError from './bundle_column_error';
 | 
			
		||||
import { Compose, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, FavouritedStatuses } from '../../ui/util/async-components';
 | 
			
		||||
 | 
			
		||||
import { scrollRight } from '../../../scroll';
 | 
			
		||||
 | 
			
		||||
const componentMap = {
 | 
			
		||||
  'COMPOSE': Compose,
 | 
			
		||||
  'HOME': HomeTimeline,
 | 
			
		||||
@@ -49,9 +51,13 @@ export default class ColumnsArea extends ImmutablePureComponent {
 | 
			
		||||
    this.setState({ shouldAnimate: true });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  componentDidUpdate() {
 | 
			
		||||
  componentDidUpdate(prevProps) {
 | 
			
		||||
    this.lastIndex = getIndex(this.context.router.history.location.pathname);
 | 
			
		||||
    this.setState({ shouldAnimate: true });
 | 
			
		||||
 | 
			
		||||
    if (this.props.children !== prevProps.children && !this.props.singleColumn) {
 | 
			
		||||
      scrollRight(this.node);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleSwipe = (index) => {
 | 
			
		||||
@@ -74,6 +80,10 @@ export default class ColumnsArea extends ImmutablePureComponent {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  setRef = (node) => {
 | 
			
		||||
    this.node = node;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  renderView = (link, index) => {
 | 
			
		||||
    const columnIndex = getIndex(this.context.router.history.location.pathname);
 | 
			
		||||
    const title = this.props.intl.formatMessage({ id: link.props['data-preview-title-id'] });
 | 
			
		||||
@@ -114,7 +124,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
      <div className='columns-area'>
 | 
			
		||||
      <div className='columns-area' ref={this.setRef}>
 | 
			
		||||
        {columns.map(column => {
 | 
			
		||||
          const params = column.get('params', null) === null ? null : column.get('params').toJS();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,7 @@ import { debounce } from 'lodash';
 | 
			
		||||
import { uploadCompose } from '../../actions/compose';
 | 
			
		||||
import { refreshHomeTimeline } from '../../actions/timelines';
 | 
			
		||||
import { refreshNotifications } from '../../actions/notifications';
 | 
			
		||||
import { clearStatusesHeight } from '../../actions/statuses';
 | 
			
		||||
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
 | 
			
		||||
import UploadArea from './components/upload_area';
 | 
			
		||||
import ColumnsAreaContainer from './containers/columns_area_container';
 | 
			
		||||
@@ -72,6 +73,9 @@ export default class UI extends React.PureComponent {
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleResize = debounce(() => {
 | 
			
		||||
    // The cached heights are no longer accurate, invalidate
 | 
			
		||||
    this.props.dispatch(clearStatusesHeight());
 | 
			
		||||
 | 
			
		||||
    this.setState({ width: window.innerWidth });
 | 
			
		||||
  }, 500, {
 | 
			
		||||
    trailing: true,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user