diff --git a/app/javascript/gabsocial/actions/timelines.js b/app/javascript/gabsocial/actions/timelines.js index a0c91b69..5f112193 100644 --- a/app/javascript/gabsocial/actions/timelines.js +++ b/app/javascript/gabsocial/actions/timelines.js @@ -86,9 +86,6 @@ export const dequeueTimeline = (timeline, expandFunc, optionalExpandArgs) => (di if (timeline === 'home') { dispatch(clearTimeline(timeline)) dispatch(expandHomeTimeline(optionalExpandArgs)) - } else if (timeline === 'community') { - dispatch(clearTimeline(timeline)) - dispatch(expandCommunityTimeline(optionalExpandArgs)) } else { shouldDispatchDequeue = false } @@ -238,16 +235,6 @@ export const expandProTimeline = ({ maxId } = {}, done = noop) => { }, done) } -/** - * - */ -export const expandCommunityTimeline = ({ maxId, onlyMedia } = {}, done = noop) => { - return expandTimeline(`community${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', { - max_id: maxId, - only_media: !!onlyMedia, - }, done) -} - /** * */ diff --git a/app/javascript/gabsocial/features/community_timeline.js b/app/javascript/gabsocial/features/community_timeline.js deleted file mode 100644 index 1687b272..00000000 --- a/app/javascript/gabsocial/features/community_timeline.js +++ /dev/null @@ -1,65 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import { connect } from 'react-redux' -import { defineMessages, injectIntl } from 'react-intl' -import { expandCommunityTimeline } from '../actions/timelines' -import StatusList from '../components/status_list' - -class CommunityTimeline extends React.PureComponent { - - static contextTypes = { - router: PropTypes.object, - } - - componentDidMount () { - const { dispatch, onlyMedia } = this.props - - dispatch(expandCommunityTimeline({ onlyMedia })) - } - - componentDidUpdate (prevProps) { - if (prevProps.onlyMedia !== this.props.onlyMedia) { - const { dispatch, onlyMedia } = this.props - - dispatch(expandCommunityTimeline({ onlyMedia })) - } - } - - handleLoadMore = maxId => { - const { dispatch, onlyMedia } = this.props - - dispatch(expandCommunityTimeline({ maxId, onlyMedia })) - } - - render () { - const { intl, onlyMedia } = this.props - - const emptyMessage = intl.formatMessage(messages.empty) - - return ( - - ) - } - -} - -const messages = defineMessages({ - empty: { id: 'empty_column.community', defaultMessage: 'The community timeline is empty. Write something publicly to get the ball rolling!' }, -}) - -const mapStateToProps = (state) => ({ - onlyMedia: state.getIn(['settings', 'community', 'other', 'onlyMedia']) -}) - -CommunityTimeline.propTypes = { - dispatch: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - onlyMedia: PropTypes.bool, -} - -export default injectIntl(connect(mapStateToProps)(CommunityTimeline)) \ No newline at end of file diff --git a/app/javascript/gabsocial/features/ui/ui.js b/app/javascript/gabsocial/features/ui/ui.js index 57d44b48..a3ba4796 100644 --- a/app/javascript/gabsocial/features/ui/ui.js +++ b/app/javascript/gabsocial/features/ui/ui.js @@ -71,7 +71,6 @@ import { ChatConversationRequests, ChatConversationBlockedAccounts, ChatConversationMutes, - CommunityTimeline, Compose, Deck, DMCA, @@ -227,7 +226,6 @@ class SwitchingArea extends React.PureComponent { - diff --git a/app/javascript/gabsocial/features/ui/util/async_components.js b/app/javascript/gabsocial/features/ui/util/async_components.js index 5c809290..5c0bc2dc 100644 --- a/app/javascript/gabsocial/features/ui/util/async_components.js +++ b/app/javascript/gabsocial/features/ui/util/async_components.js @@ -28,7 +28,6 @@ export function ChatConversationMutes() { return import(/* webpackChunkName: "fe export function ChatMessageOptionsPopover() { return import(/* webpackChunkName: "components/chat_message_options_popover" */'../../../components/popover/chat_message_options_popover') } export function ChatSettingsPopover() { return import(/* webpackChunkName: "components/chat_settings_popover" */'../../../components/popover/chat_settings_popover') } export function CommentSortingOptionsPopover() { return import(/* webpackChunkName: "components/comment_sorting_options_popover" */'../../../components/popover/comment_sorting_options_popover') } -export function CommunityTimeline() { return import(/* webpackChunkName: "features/community_timeline" */'../../community_timeline') } export function Compose() { return import(/* webpackChunkName: "features/compose" */'../../compose') } export function ComposeForm() { return import(/* webpackChunkName: "components/compose_form" */'../../compose/components/compose_form') } export function ComposeModal() { return import(/* webpackChunkName: "components/compose_modal" */'../../../components/modal/compose_modal') } diff --git a/config/routes.rb b/config/routes.rb index 53b367bb..3d954ffd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -210,7 +210,6 @@ Rails.application.routes.draw do namespace :timelines do resource :home, only: :show, controller: :home - resource :public, only: :show, controller: :public resource :pro, only: :show, controller: :pro resources :tag, only: :show resources :list, only: :show