[Glitch] Run eslint --fix
I don't like it changing files this way, but it's basically what
c49213f0ea and a few others did.
			
			
This commit is contained in:
		@@ -52,7 +52,7 @@ export default class ActionsModal extends ImmutablePureComponent {
 | 
			
		||||
        </a>
 | 
			
		||||
      </li>
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const status = this.props.status && (
 | 
			
		||||
 
 | 
			
		||||
@@ -55,20 +55,20 @@ class BlockModal extends React.PureComponent {
 | 
			
		||||
  handleClick = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
    this.props.onConfirm(this.props.account);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleSecondary = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
    this.props.onBlockAndReport(this.props.account);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleCancel = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.button = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { account } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -58,17 +58,17 @@ class BoostModal extends ImmutablePureComponent {
 | 
			
		||||
  handleReblog = () => {
 | 
			
		||||
    this.props.onReblog(this.props.status, this.props.privacy);
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleAccountClick = (e) => {
 | 
			
		||||
    if (e.button === 0) {
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
      this.props.onClose();
 | 
			
		||||
      let state = {...this.context.router.history.location.state};
 | 
			
		||||
      let state = { ...this.context.router.history.location.state };
 | 
			
		||||
      state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
 | 
			
		||||
      this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  _findContainer = () => {
 | 
			
		||||
    return document.getElementsByClassName('modal-root__container')[0];
 | 
			
		||||
@@ -76,7 +76,7 @@ class BoostModal extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.button = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { status, missingMediaDescription, privacy, intl } = this.props;
 | 
			
		||||
@@ -116,9 +116,9 @@ class BoostModal extends ImmutablePureComponent {
 | 
			
		||||
        <div className='boost-modal__action-bar'>
 | 
			
		||||
          <div>
 | 
			
		||||
            { missingMediaDescription ?
 | 
			
		||||
                <FormattedMessage id='boost_modal.missing_description' defaultMessage='This toot contains some media without description' />
 | 
			
		||||
              <FormattedMessage id='boost_modal.missing_description' defaultMessage='This toot contains some media without description' />
 | 
			
		||||
              :
 | 
			
		||||
                <FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <Icon id='retweet' /></span> }} />
 | 
			
		||||
              <FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <Icon id='retweet' /></span> }} />
 | 
			
		||||
            }
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ class Bundle extends React.Component {
 | 
			
		||||
    onFetch: PropTypes.func,
 | 
			
		||||
    onFetchSuccess: PropTypes.func,
 | 
			
		||||
    onFetchFail: PropTypes.func,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  static defaultProps = {
 | 
			
		||||
    loading: emptyComponent,
 | 
			
		||||
@@ -24,14 +24,14 @@ class Bundle extends React.Component {
 | 
			
		||||
    onFetch: noop,
 | 
			
		||||
    onFetchSuccess: noop,
 | 
			
		||||
    onFetchFail: noop,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  static cache = {}
 | 
			
		||||
  static cache = {};
 | 
			
		||||
 | 
			
		||||
  state = {
 | 
			
		||||
    mod: undefined,
 | 
			
		||||
    forceRender: false,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentWillMount() {
 | 
			
		||||
    this.load(this.props);
 | 
			
		||||
@@ -84,7 +84,7 @@ class Bundle extends React.Component {
 | 
			
		||||
        this.setState({ mod: null });
 | 
			
		||||
        onFetchFail(error);
 | 
			
		||||
      });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render() {
 | 
			
		||||
    const { loading: Loading, error: Error, children, renderDelay } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ class GIF extends React.PureComponent {
 | 
			
		||||
    if (!animate) {
 | 
			
		||||
      this.setState({ hovering: true });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleMouseLeave = () => {
 | 
			
		||||
    const { animate } = this.props;
 | 
			
		||||
@@ -39,7 +39,7 @@ class GIF extends React.PureComponent {
 | 
			
		||||
    if (!animate) {
 | 
			
		||||
      this.setState({ hovering: false });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { src, staticSrc, className, animate } = this.props;
 | 
			
		||||
@@ -75,7 +75,7 @@ class CopyButton extends React.PureComponent {
 | 
			
		||||
    navigator.clipboard.writeText(value);
 | 
			
		||||
    this.setState({ copied: true });
 | 
			
		||||
    this.timeout = setTimeout(() => this.setState({ copied: false }), 700);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentWillUnmount () {
 | 
			
		||||
    if (this.timeout) clearTimeout(this.timeout);
 | 
			
		||||
@@ -113,7 +113,7 @@ class BundleColumnError extends React.PureComponent {
 | 
			
		||||
    if (onRetry) {
 | 
			
		||||
      onRetry();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { errorType, multiColumn, stacktrace } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -16,11 +16,11 @@ class BundleModalError extends React.Component {
 | 
			
		||||
    onRetry: PropTypes.func.isRequired,
 | 
			
		||||
    onClose: PropTypes.func.isRequired,
 | 
			
		||||
    intl: PropTypes.object.isRequired,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleRetry = () => {
 | 
			
		||||
    this.props.onRetry();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { onClose, intl: { formatMessage } } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ export default class Column extends React.PureComponent {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this._interruptScrollAnimation = scrollTop(scrollable);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  scrollTop () {
 | 
			
		||||
    const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable');
 | 
			
		||||
@@ -42,11 +42,11 @@ export default class Column extends React.PureComponent {
 | 
			
		||||
    if (typeof this._interruptScrollAnimation !== 'undefined') {
 | 
			
		||||
      this._interruptScrollAnimation();
 | 
			
		||||
    }
 | 
			
		||||
  }, 200)
 | 
			
		||||
  }, 200);
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.node = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ export default class ColumnHeader extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
  handleClick = () => {
 | 
			
		||||
    this.props.onClick();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { icon, type, active, columnHeaderId } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ const ColumnLink = ({ icon, text, to, onClick, href, method, badge, transparent,
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
      e.stopPropagation();
 | 
			
		||||
      return onClick(e);
 | 
			
		||||
    }
 | 
			
		||||
    };
 | 
			
		||||
    return (
 | 
			
		||||
      <a href='#' onClick={onClick && handleOnClick} className={className} title={text} {...other} tabIndex='0'>
 | 
			
		||||
        {iconElement}
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  state = {
 | 
			
		||||
    renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches),
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentDidMount() {
 | 
			
		||||
    if (!this.props.singleColumn) {
 | 
			
		||||
@@ -113,7 +113,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  handleLayoutChange = (e) => {
 | 
			
		||||
    this.setState({ renderComposePanel: !e.matches });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleWheel = () => {
 | 
			
		||||
    if (typeof this._interruptScrollAnimation !== 'function') {
 | 
			
		||||
@@ -121,19 +121,19 @@ export default class ColumnsArea extends ImmutablePureComponent {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this._interruptScrollAnimation();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = (node) => {
 | 
			
		||||
    this.node = node;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  renderLoading = columnId => () => {
 | 
			
		||||
    return columnId === 'COMPOSE' ? <DrawerLoading /> : <ColumnLoading multiColumn />;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  renderError = (props) => {
 | 
			
		||||
    return <BundleColumnError multiColumn errorType='network' {...props} />;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { columns, children, singleColumn, navbarUnder, openSettings } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -55,4 +55,4 @@ class ComposePanel extends React.PureComponent {
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -34,24 +34,24 @@ class ConfirmationModal extends React.PureComponent {
 | 
			
		||||
    if (this.props.onDoNotAsk && this.doNotAskCheckbox.checked) {
 | 
			
		||||
      this.props.onDoNotAsk();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleSecondary = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
    this.props.onSecondary();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleCancel = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.button = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setDoNotAskRef = (c) => {
 | 
			
		||||
    this.doNotAskCheckbox = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { message, confirm, secondary, onDoNotAsk } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -30,11 +30,11 @@ class DeprecatedSettingsModal extends React.PureComponent {
 | 
			
		||||
  handleClick = () => {
 | 
			
		||||
    this.props.onConfirm();
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.button = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { settings, intl } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ class DisabledAccountBanner extends React.PureComponent {
 | 
			
		||||
    this.props.onLogout();
 | 
			
		||||
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { disabledAcct, movedToAcct } = this.props;
 | 
			
		||||
@@ -89,4 +89,4 @@ class DisabledAccountBanner extends React.PureComponent {
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -279,7 +279,7 @@ class DoodleModal extends ImmutablePureComponent {
 | 
			
		||||
    this.swapped = false;
 | 
			
		||||
    window.addEventListener('keyup', this.handleKeyUp, false);
 | 
			
		||||
    window.addEventListener('keydown', this.handleKeyDown, false);
 | 
			
		||||
  };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Tear component down
 | 
			
		||||
@@ -575,7 +575,7 @@ class DoodleModal extends ImmutablePureComponent {
 | 
			
		||||
            <div>
 | 
			
		||||
              <select aria-label='Canvas size' onInput={this.changeSize} defaultValue={this.size}>
 | 
			
		||||
                { Object.values(mapValues(DOODLE_SIZES, (val, k) =>
 | 
			
		||||
                  <option key={k} value={k}>{val[2]}</option>
 | 
			
		||||
                  <option key={k} value={k}>{val[2]}</option>,
 | 
			
		||||
                )) }
 | 
			
		||||
              </select>
 | 
			
		||||
            </div>
 | 
			
		||||
@@ -602,7 +602,7 @@ class DoodleModal extends ImmutablePureComponent {
 | 
			
		||||
                      'foreground': this.fg === c[0],
 | 
			
		||||
                      'background': this.bg === c[0],
 | 
			
		||||
                    })}
 | 
			
		||||
                  />
 | 
			
		||||
                  />,
 | 
			
		||||
              )
 | 
			
		||||
            }
 | 
			
		||||
          </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ class EmbedModal extends ImmutablePureComponent {
 | 
			
		||||
    onClose: PropTypes.func.isRequired,
 | 
			
		||||
    onError: PropTypes.func.isRequired,
 | 
			
		||||
    intl: PropTypes.object.isRequired,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  state = {
 | 
			
		||||
    loading: false,
 | 
			
		||||
@@ -48,11 +48,11 @@ class EmbedModal extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  setIframeRef = c =>  {
 | 
			
		||||
    this.iframe = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTextareaClick = (e) => {
 | 
			
		||||
    e.target.select();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { intl, onClose } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -38,21 +38,21 @@ class FavouriteModal extends ImmutablePureComponent {
 | 
			
		||||
  handleFavourite = () => {
 | 
			
		||||
    this.props.onFavourite(this.props.status);
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleAccountClick = (e) => {
 | 
			
		||||
    if (e.button === 0) {
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
      this.props.onClose();
 | 
			
		||||
      let state = {...this.context.router.history.location.state};
 | 
			
		||||
      let state = { ...this.context.router.history.location.state };
 | 
			
		||||
      state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
 | 
			
		||||
      this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.button = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { status, intl } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -135,7 +135,7 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
    this.updatePosition(e);
 | 
			
		||||
    this.setState({ dragging: true });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTouchStart = e => {
 | 
			
		||||
    document.addEventListener('touchmove', this.handleMouseMove);
 | 
			
		||||
@@ -143,25 +143,25 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
    this.updatePosition(e);
 | 
			
		||||
    this.setState({ dragging: true });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleMouseMove = e => {
 | 
			
		||||
    this.updatePosition(e);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleMouseUp = () => {
 | 
			
		||||
    document.removeEventListener('mousemove', this.handleMouseMove);
 | 
			
		||||
    document.removeEventListener('mouseup', this.handleMouseUp);
 | 
			
		||||
 | 
			
		||||
    this.setState({ dragging: false });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTouchEnd = () => {
 | 
			
		||||
    document.removeEventListener('touchmove', this.handleMouseMove);
 | 
			
		||||
    document.removeEventListener('touchend', this.handleTouchEnd);
 | 
			
		||||
 | 
			
		||||
    this.setState({ dragging: false });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  updatePosition = e => {
 | 
			
		||||
    const { x, y } = getPointerPosition(this.node, e);
 | 
			
		||||
@@ -169,11 +169,11 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
			
		||||
    const focusY   = (y - .5) * -2;
 | 
			
		||||
 | 
			
		||||
    this.props.onChangeFocus(focusX, focusY);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleChange = e => {
 | 
			
		||||
    this.props.onChangeDescription(e.target.value);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleKeyDown = (e) => {
 | 
			
		||||
    if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
 | 
			
		||||
@@ -182,11 +182,11 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
			
		||||
      this.props.onChangeDescription(e.target.value);
 | 
			
		||||
      this.handleSubmit();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleSubmit = () => {
 | 
			
		||||
    this.props.onSave(this.props.description, this.props.focusX, this.props.focusY);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  getCloseConfirmationMessage = () => {
 | 
			
		||||
    const { intl, dirty } = this.props;
 | 
			
		||||
@@ -199,15 +199,15 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
			
		||||
    } else {
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = c => {
 | 
			
		||||
    this.node = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTextDetection = () => {
 | 
			
		||||
    this._detectText();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  _detectText = (refreshCache = false) => {
 | 
			
		||||
    const { media } = this.props;
 | 
			
		||||
@@ -258,21 +258,21 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
			
		||||
      console.error(e);
 | 
			
		||||
      this.setState({ detecting: false });
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleThumbnailChange = e => {
 | 
			
		||||
    if (e.target.files.length > 0) {
 | 
			
		||||
      this.props.onSelectThumbnail(e.target.files);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setFileInputRef = c => {
 | 
			
		||||
    this.fileInput = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleFileInputClick = () => {
 | 
			
		||||
    this.fileInput.click();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { media, intl, account, onClose, isUploadingThumbnail, description, lang, focusX, focusY, dirty, is_changing_upload } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ export default class ImageLoader extends PureComponent {
 | 
			
		||||
    height: PropTypes.number,
 | 
			
		||||
    onClick: PropTypes.func,
 | 
			
		||||
    zoomButtonHidden: PropTypes.bool,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  static defaultProps = {
 | 
			
		||||
    alt: '',
 | 
			
		||||
@@ -26,7 +26,7 @@ export default class ImageLoader extends PureComponent {
 | 
			
		||||
    loading: true,
 | 
			
		||||
    error: false,
 | 
			
		||||
    width: null,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  removers = [];
 | 
			
		||||
  canvas = null;
 | 
			
		||||
@@ -86,7 +86,7 @@ export default class ImageLoader extends PureComponent {
 | 
			
		||||
    image.addEventListener('load', handleLoad);
 | 
			
		||||
    image.src = previewSrc;
 | 
			
		||||
    this.removers.push(removeEventListeners);
 | 
			
		||||
  })
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  clearPreviewCanvas () {
 | 
			
		||||
    const { width, height } = this.canvas;
 | 
			
		||||
@@ -126,7 +126,7 @@ export default class ImageLoader extends PureComponent {
 | 
			
		||||
  setCanvasRef = c => {
 | 
			
		||||
    this.canvas = c;
 | 
			
		||||
    if (c) this.setState({ width: c.offsetWidth });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { alt, src, width, height, onClick } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ class LinkFooter extends React.PureComponent {
 | 
			
		||||
    this.props.onLogout();
 | 
			
		||||
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { signedIn, permissions } = this.context.identity;
 | 
			
		||||
@@ -93,4 +93,4 @@ class LinkFooter extends React.PureComponent {
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -47,27 +47,27 @@ class MediaModal extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  handleSwipe = (index) => {
 | 
			
		||||
    this.setState({ index: index % this.props.media.size });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTransitionEnd = () => {
 | 
			
		||||
    this.setState({
 | 
			
		||||
      zoomButtonHidden: false,
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleNextClick = () => {
 | 
			
		||||
    this.setState({
 | 
			
		||||
      index: (this.getIndex() + 1) % this.props.media.size,
 | 
			
		||||
      zoomButtonHidden: true,
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handlePrevClick = () => {
 | 
			
		||||
    this.setState({
 | 
			
		||||
      index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size,
 | 
			
		||||
      zoomButtonHidden: true,
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleChangeIndex = (e) => {
 | 
			
		||||
    const index = Number(e.currentTarget.getAttribute('data-index'));
 | 
			
		||||
@@ -76,7 +76,7 @@ class MediaModal extends ImmutablePureComponent {
 | 
			
		||||
      index: index % this.props.media.size,
 | 
			
		||||
      zoomButtonHidden: true,
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleKeyDown = (e) => {
 | 
			
		||||
    switch(e.key) {
 | 
			
		||||
@@ -91,7 +91,7 @@ class MediaModal extends ImmutablePureComponent {
 | 
			
		||||
      e.stopPropagation();
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentDidMount () {
 | 
			
		||||
    window.addEventListener('keydown', this.handleKeyDown, false);
 | 
			
		||||
 
 | 
			
		||||
@@ -76,7 +76,7 @@ export default class ModalRoot extends React.PureComponent {
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentDidUpdate () {
 | 
			
		||||
    if (!!this.props.type) {
 | 
			
		||||
    if (this.props.type) {
 | 
			
		||||
      document.body.classList.add('with-modals--active');
 | 
			
		||||
      document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -87,17 +87,17 @@ export default class ModalRoot extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
  setBackgroundColor = color => {
 | 
			
		||||
    this.setState({ backgroundColor: color });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  renderLoading = modalId => () => {
 | 
			
		||||
    return ['MEDIA', 'VIDEO', 'BOOST', 'FAVOURITE', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  renderError = (props) => {
 | 
			
		||||
    const { onClose } = this.props;
 | 
			
		||||
 | 
			
		||||
    return <BundleModalError {...props} onClose={onClose} />;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleClose = (ignoreFocus = false) => {
 | 
			
		||||
    const { onClose } = this.props;
 | 
			
		||||
@@ -110,14 +110,14 @@ export default class ModalRoot extends React.PureComponent {
 | 
			
		||||
      // This would be much smoother with react-intl 3+ and `forwardRef`.
 | 
			
		||||
    }
 | 
			
		||||
    onClose(message, ignoreFocus);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setModalRef = (c) => {
 | 
			
		||||
    this._modal = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  // prevent closing of modal when clicking the overlay
 | 
			
		||||
  noop = () => {}
 | 
			
		||||
  noop = () => {};
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { type, props, ignoreFocus } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -65,23 +65,23 @@ class MuteModal extends React.PureComponent {
 | 
			
		||||
  handleClick = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
    this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleCancel = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setRef = (c) => {
 | 
			
		||||
    this.button = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  toggleNotifications = () => {
 | 
			
		||||
    this.props.onToggleNotifications();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  changeMuteDuration = (e) => {
 | 
			
		||||
    this.props.onChangeMuteDuration(e);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { account, notifications, muteDuration, intl } = this.props;
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ const PageTwo = ({ intl, myAccount }) => (
 | 
			
		||||
          privacy='public'
 | 
			
		||||
          text='Awoo! #introductions'
 | 
			
		||||
          spoilerText=''
 | 
			
		||||
          suggestions={ [] }
 | 
			
		||||
          suggestions={[]}
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -195,7 +195,7 @@ class OnboardingModal extends React.PureComponent {
 | 
			
		||||
      <PageFour domain={domain} intl={intl} />,
 | 
			
		||||
      <PageSix admin={admin} domain={domain} />,
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  componentDidMount() {
 | 
			
		||||
    window.addEventListener('keyup', this.handleKeyUp);
 | 
			
		||||
@@ -208,30 +208,30 @@ class OnboardingModal extends React.PureComponent {
 | 
			
		||||
  handleSkip = (e) => {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleDot = (e) => {
 | 
			
		||||
    const i = Number(e.currentTarget.getAttribute('data-index'));
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
    this.setState({ currentIndex: i });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handlePrev = () => {
 | 
			
		||||
    this.setState(({ currentIndex }) => ({
 | 
			
		||||
      currentIndex: Math.max(0, currentIndex - 1),
 | 
			
		||||
    }));
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleNext = () => {
 | 
			
		||||
    const { pages } = this;
 | 
			
		||||
    this.setState(({ currentIndex }) => ({
 | 
			
		||||
      currentIndex: Math.min(currentIndex + 1, pages.length - 1),
 | 
			
		||||
    }));
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleSwipe = (index) => {
 | 
			
		||||
    this.setState({ currentIndex: index });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleKeyUp = ({ key }) => {
 | 
			
		||||
    switch (key) {
 | 
			
		||||
@@ -242,11 +242,11 @@ class OnboardingModal extends React.PureComponent {
 | 
			
		||||
      this.handleNext();
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleClose = () => {
 | 
			
		||||
    this.props.onClose();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { pages } = this;
 | 
			
		||||
 
 | 
			
		||||
@@ -96,7 +96,7 @@ class ReportModal extends ImmutablePureComponent {
 | 
			
		||||
    } else {
 | 
			
		||||
      this.setState({ selectedRuleIds: selectedRuleIds.remove(ruleId) });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleChangeCategory = category => {
 | 
			
		||||
    this.setState({ category });
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ export default class UploadArea extends React.PureComponent {
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentDidMount () {
 | 
			
		||||
    window.addEventListener('keyup', this.handleKeyUp, false);
 | 
			
		||||
 
 | 
			
		||||
@@ -102,7 +102,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
    onClick: PropTypes.func,
 | 
			
		||||
    zoomButtonHidden: PropTypes.bool,
 | 
			
		||||
    intl: PropTypes.object.isRequired,
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  static defaultProps = {
 | 
			
		||||
    alt: '',
 | 
			
		||||
@@ -132,7 +132,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
    dragged: false,
 | 
			
		||||
    lockScroll: { x: 0, y: 0 },
 | 
			
		||||
    lockTranslate: { x: 0, y: 0 },
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  removers = [];
 | 
			
		||||
  container = null;
 | 
			
		||||
@@ -212,7 +212,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
    // lock horizontal scroll
 | 
			
		||||
    this.container.scrollLeft = Math.max(this.container.scrollLeft + event.pixelX, this.state.lockScroll.x);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  mouseDownHandler = e => {
 | 
			
		||||
    this.container.style.cursor = 'grabbing';
 | 
			
		||||
@@ -228,7 +228,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
    this.image.addEventListener('mousemove', this.mouseMoveHandler);
 | 
			
		||||
    this.image.addEventListener('mouseup', this.mouseUpHandler);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  mouseMoveHandler = e => {
 | 
			
		||||
    const dx = e.clientX - this.state.dragPosition.x;
 | 
			
		||||
@@ -238,7 +238,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
    this.container.scrollTop = Math.max(this.state.dragPosition.top - dy, this.state.lockScroll.y);
 | 
			
		||||
 | 
			
		||||
    this.setState({ dragged: true });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  mouseUpHandler = () => {
 | 
			
		||||
    this.container.style.cursor = 'grab';
 | 
			
		||||
@@ -246,13 +246,13 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
    this.image.removeEventListener('mousemove', this.mouseMoveHandler);
 | 
			
		||||
    this.image.removeEventListener('mouseup', this.mouseUpHandler);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTouchStart = e => {
 | 
			
		||||
    if (e.touches.length !== 2) return;
 | 
			
		||||
 | 
			
		||||
    this.lastDistance = getDistance(...e.touches);
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleTouchMove = e => {
 | 
			
		||||
    const { scrollTop, scrollHeight, clientHeight } = this.container;
 | 
			
		||||
@@ -275,7 +275,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
    this.lastMidpoint = midpoint;
 | 
			
		||||
    this.lastDistance = distance;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  zoom(nextScale, midpoint) {
 | 
			
		||||
    const { scale, zoomMatrix } = this.state;
 | 
			
		||||
@@ -314,11 +314,11 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
    const handler = this.props.onClick;
 | 
			
		||||
    if (handler) handler();
 | 
			
		||||
    this.setState({ navigationHidden: !this.state.navigationHidden });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleMouseDown = e => {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  initZoomMatrix = () => {
 | 
			
		||||
    const { width, height } = this.props;
 | 
			
		||||
@@ -350,7 +350,7 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
        translateY: translateY,
 | 
			
		||||
      },
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  handleZoomClick = e => {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
@@ -392,15 +392,15 @@ class ZoomableImage extends React.PureComponent {
 | 
			
		||||
 | 
			
		||||
    this.container.style.cursor = 'grab';
 | 
			
		||||
    this.container.style.removeProperty('user-select');
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setContainerRef = c => {
 | 
			
		||||
    this.container = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  setImageRef = c => {
 | 
			
		||||
    this.image = c;
 | 
			
		||||
  }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { alt, src, width, height, intl } = this.props;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user