ソースを参照

error fixed (when loading pages in single column mode.) (#4746)

master
MitarashiDango 6年前
committed by Eugen Rochko
コミット
fec13735a7
1個のファイルの変更16行の追加3行の削除
  1. +16
    -3
      app/javascript/mastodon/features/ui/components/columns_area.js

+ 16
- 3
app/javascript/mastodon/features/ui/components/columns_area.js ファイルの表示

@@ -48,18 +48,31 @@ export default class ColumnsArea extends ImmutablePureComponent {
}

componentDidMount() {
this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents ? { passive: true } : false);
if (!this.props.singleColumn) {
this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents ? { passive: true } : false);
}
this.lastIndex = getIndex(this.context.router.history.location.pathname);
this.setState({ shouldAnimate: true });
}

componentDidUpdate() {
componentWillUpdate(nextProps) {
if (this.props.singleColumn !== nextProps.singleColumn && nextProps.singleColumn) {
this.node.removeEventListener('wheel', this.handleWheel);
}
}

componentDidUpdate(prevProps) {
if (this.props.singleColumn !== prevProps.singleColumn && !this.props.singleColumn) {
this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents ? { passive: true } : false);
}
this.lastIndex = getIndex(this.context.router.history.location.pathname);
this.setState({ shouldAnimate: true });
}

componentWillUnmount () {
this.node.removeEventListener('wheel', this.handleWheel);
if (!this.props.singleColumn) {
this.node.removeEventListener('wheel', this.handleWheel);
}
}

handleChildrenContentChange() {


読み込み中…
キャンセル
保存