From 0eb3ae2dfa7efd294e6b74e6da01f749cff0ef23 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Tue, 14 Jul 2020 18:48:48 -0500 Subject: [PATCH] Removed Introduction/onboarding code from ui.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Will be moving elsewhere... • Removed: - Introduction/onboarding code from ui.js - /welcome route --- app/javascript/gabsocial/features/ui/ui.js | 32 ++-------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/app/javascript/gabsocial/features/ui/ui.js b/app/javascript/gabsocial/features/ui/ui.js index 302701a8..8aa8a0fe 100644 --- a/app/javascript/gabsocial/features/ui/ui.js +++ b/app/javascript/gabsocial/features/ui/ui.js @@ -16,7 +16,6 @@ import { } from '../../actions/notifications' import LoadingBar from '../../components/loading_bar' import { fetchFilters } from '../../actions/filters' -import { MIN_ACCOUNT_CREATED_AT_ONBOARDING } from '../../actions/onboarding' import { clearHeight } from '../../actions/height_cache' import { openModal } from '../../actions/modal' import WrappedRoute from './util/wrapped_route' @@ -40,7 +39,6 @@ import ModalPage from '../../pages/modal_page' import SettingsPage from '../../pages/settings_page' import ProPage from '../../pages/pro_page' import ExplorePage from '../../pages/explore_page' -import IntroductionPage from '../../pages/introduction_page' import AboutPage from '../../pages/about_page' // import AuthPage from '../../pages/auth_page' @@ -66,7 +64,6 @@ import { GroupTimeline, HashtagTimeline, HomeTimeline, - Introduction, Investors, LikedStatuses, ListCreate, @@ -97,8 +94,6 @@ const messages = defineMessages({ }) const mapStateToProps = (state) => ({ - shownOnboarding: state.getIn(['settings', 'shownOnboarding'], false), - accountCreatedAt: state.getIn(['accounts', me, 'created_at']), isComposing: state.getIn(['compose', 'is_composing']), hasComposingText: state.getIn(['compose', 'text']).trim().length !== 0, hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0, @@ -134,7 +129,6 @@ class SwitchingArea extends PureComponent { children: PropTypes.node, location: PropTypes.object, onLayoutChange: PropTypes.func.isRequired, - shownOnboarding: PropTypes.bool.isRequired, } componentDidMount() { @@ -166,7 +160,6 @@ class SwitchingArea extends PureComponent { - @@ -269,8 +262,6 @@ class UI extends PureComponent { hasMediaAttachments: PropTypes.bool, location: PropTypes.object, intl: PropTypes.object.isRequired, - shownOnboarding: PropTypes.bool.isRequired, - accountCreatedAt: PropTypes.string.isRequired, } state = { @@ -387,15 +378,6 @@ class UI extends PureComponent { componentWillMount() { if (!me) return - //If first time opening app, and is new user, show onboarding - const accountCreatedAtValue = moment(this.props.accountCreatedAt).valueOf() - const shouldShowOnboarding = !this.props.shownOnboarding && accountCreatedAtValue > MIN_ACCOUNT_CREATED_AT_ONBOARDING - - if (shouldShowOnboarding) { - this.context.router.history.push('/welcome') - return - } - window.addEventListener('beforeunload', this.handleBeforeUnload, false) document.addEventListener('dragenter', this.handleDragEnter, false) @@ -434,8 +416,6 @@ class UI extends PureComponent { this.setState({ fetchedNotifications: true }) this.props.dispatch(expandNotifications()) - } else if (pathname === '/welcome') { - this.context.router.history.push('/home') } this.props.dispatch(initializeNotifications()) @@ -552,11 +532,7 @@ class UI extends PureComponent { } render() { - const { - children, - location, - shownOnboarding, - } = this.props + const { children, location } = this.props const { draggingOver } = this.state // : todo : @@ -580,11 +556,7 @@ class UI extends PureComponent {
- + {children}