Skip to content

Commit

Permalink
Revert "Remove column when disabled timeline"
Browse files Browse the repository at this point in the history
This reverts commit f87f7d1.
  • Loading branch information
atsu1125 committed Mar 13, 2023
1 parent dfcf7b5 commit d47f3a3
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Fragment } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePropTypes from 'react-immutable-proptypes';
Expand Down Expand Up @@ -32,9 +32,6 @@ import NavigationPanel from './navigation_panel';
import { supportsPassiveEvents } from 'detect-passive-events';
import { scrollRight } from 'flavours/glitch/util/scroll';

import { disablePublicTimelines, disableLocalTimeline, isStaff } from 'flavours/glitch/util/initial_state';
import { removeColumn } from 'flavours/glitch/actions/columns';

const componentMap = {
'COMPOSE': Compose,
'HOME': HomeTimeline,
Expand Down Expand Up @@ -64,7 +61,6 @@ class ColumnsArea extends ImmutablePureComponent {
};

static propTypes = {
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
columns: ImmutablePropTypes.list.isRequired,
swipeToChangeColumns: PropTypes.bool,
Expand All @@ -89,8 +85,6 @@ class ColumnsArea extends ImmutablePureComponent {
}

componentDidMount() {
const { dispatch, columns } = this.props;

if (!this.props.singleColumn) {
this.node.addEventListener('wheel', this.handleWheel, supportsPassiveEvents ? { passive: true } : false);
}
Expand All @@ -108,17 +102,6 @@ class ColumnsArea extends ImmutablePureComponent {
this.isRtlLayout = document.getElementsByTagName('body')[0].classList.contains('rtl');

this.setState({ shouldAnimate: true });

const removeColumnById = id => {
const column = columns.find(item => item.get('id') === id)

if (column) {
dispatch(removeColumn(column.get('uuid')));
}
};

if (disablePublicTimelines && !isStaff) { removeColumnById('PUBLIC'); }
if (disableLocalTimeline && !isStaff) { removeColumnById('COMMUNITY'); }
}

componentWillUpdate(nextProps) {
Expand Down

0 comments on commit d47f3a3

Please sign in to comment.