From 89def69904860e5d2f9add82670d3937fa316d2a Mon Sep 17 00:00:00 2001
From: mgabdev <>
Date: Thu, 6 Aug 2020 23:09:17 -0500
Subject: [PATCH] Removed unused Explore feature
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
• Removed:
- unused Explore feature, as it is now just GroupCollectionTimeline
---
app/javascript/gabsocial/features/explore.js | 99 -------------------
app/javascript/gabsocial/features/ui/ui.js | 5 +-
.../features/ui/util/async_components.js | 1 -
3 files changed, 2 insertions(+), 103 deletions(-)
delete mode 100644 app/javascript/gabsocial/features/explore.js
diff --git a/app/javascript/gabsocial/features/explore.js b/app/javascript/gabsocial/features/explore.js
deleted file mode 100644
index ebffa841..00000000
--- a/app/javascript/gabsocial/features/explore.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import { defineMessages, injectIntl } from 'react-intl'
-import { withRouter } from 'react-router-dom'
-import throttle from 'lodash.throttle'
-import {
- expandHomeTimeline,
- forceDequeueTimeline,
-} from '../actions/timelines'
-import StatusList from '../components/status_list'
-
-const messages = defineMessages({
- title: { id: 'column.home', defaultMessage: 'Home' },
- empty: { id: 'empty_timeline.home', defaultMessage: 'Your home timeline is empty. Start following other users to receive their content here.' },
-})
-
-const mapStateToProps = (state) => ({
- isPartial: state.getIn(['timelines', 'home', 'isPartial']),
-})
-
-const mapDispatchToProps = (dispatch) => ({
- onExpandHomeTimeline(options) {
- if (!options) dispatch(forceDequeueTimeline('home'))
- dispatch(expandHomeTimeline(options))
- },
-})
-
-export default
-@injectIntl
-@withRouter
-@connect(mapStateToProps, mapDispatchToProps)
-class Explore extends PureComponent {
-
- static propTypes = {
- intl: PropTypes.object.isRequired,
- isPartial: PropTypes.bool,
- onExpandHomeTimeline: PropTypes.func.isRequired,
- }
-
- componentDidMount () {
- this._checkIfReloadNeeded(false, this.props.isPartial)
- }
-
- componentDidUpdate (prevProps) {
- this._checkIfReloadNeeded(prevProps.isPartial, this.props.isPartial)
-
- //Check if clicked on "home" button, if so, reload
- if (prevProps.location.key !== this.props.location.key &&
- prevProps.location.pathname === '/home' &&
- this.props.location.pathname === '/home') {
- this.handleReload()
- }
- }
-
- componentWillUnmount () {
- this._stopPolling()
- }
-
- handleLoadMore = (maxId) => {
- this.props.onExpandHomeTimeline({ maxId })
- }
-
- handleReload = throttle(() => {
- this.props.onExpandHomeTimeline()
- }, 5000)
-
- _checkIfReloadNeeded (wasPartial, isPartial) {
- const { onExpandHomeTimeline } = this.props
-
- if (!wasPartial && isPartial) {
- this.polling = setInterval(() => {
- onExpandHomeTimeline()
- }, 3000)
- } else if (wasPartial && !isPartial) {
- this._stopPolling()
- }
- }
-
- _stopPolling () {
- if (this.polling) {
- clearInterval(this.polling)
- this.polling = null
- }
- }
-
- render () {
- const { intl } = this.props
-
- const emptyMessage = intl.formatMessage(messages.empty)
-
- return (
-
- )
- }
-
-}
\ 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 2448d5bc..09d3c168 100644
--- a/app/javascript/gabsocial/features/ui/ui.js
+++ b/app/javascript/gabsocial/features/ui/ui.js
@@ -52,7 +52,6 @@ import {
CommunityTimeline,
Compose,
DMCA,
- Explore,
// Filters,
Followers,
Following,
@@ -167,7 +166,7 @@ class SwitchingArea extends PureComponent {
}
{
!me &&
-
+
}
@@ -179,7 +178,7 @@ class SwitchingArea extends PureComponent {
-
+
diff --git a/app/javascript/gabsocial/features/ui/util/async_components.js b/app/javascript/gabsocial/features/ui/util/async_components.js
index 235abf12..fcbfe59f 100644
--- a/app/javascript/gabsocial/features/ui/util/async_components.js
+++ b/app/javascript/gabsocial/features/ui/util/async_components.js
@@ -20,7 +20,6 @@ export function EditShortcutsModal() { return import(/* webpackChunkName: "compo
export function EmbedModal() { return import(/* webpackChunkName: "modals/embed_modal" */'../../../components/modal/embed_modal') }
export function EmojiPicker() { return import(/* webpackChunkName: "emoji_picker" */'../../../components/emoji/emoji_picker') }
export function EmojiPickerPopover() { return import(/* webpackChunkName: "components/emoji_picker_popover" */'../../../components/popover/emoji_picker_popover') }
-export function Explore() { return import(/* webpackChunkName: "features/explore" */'../../explore') }
export function Followers() { return import(/* webpackChunkName: "features/followers" */'../../followers') }
export function Following() { return import(/* webpackChunkName: "features/following" */'../../following') }
export function FollowRequests() { return import(/* webpackChunkName: "features/follow_requests" */'../../follow_requests') }