Change landing page to be /about instead of /explore when trends are disabled (#19414)

rebase/4.0.0rc1
Claire 2022-10-22 18:09:51 +02:00 committed by GitHub
parent 53e86747e4
commit 062b3c9090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ import {
About, About,
PrivacyPolicy, PrivacyPolicy,
} from './util/async-components'; } from './util/async-components';
import initialState, { me, owner, singleUserMode } from '../../initial_state'; import initialState, { me, owner, singleUserMode, showTrends } from '../../initial_state';
import { closeOnboarding, INTRODUCTION_VERSION } from 'mastodon/actions/onboarding'; import { closeOnboarding, INTRODUCTION_VERSION } from 'mastodon/actions/onboarding';
import Header from './components/header'; import Header from './components/header';
@ -163,8 +163,10 @@ class SwitchingColumnsArea extends React.PureComponent {
} }
} else if (singleUserMode && owner && initialState?.accounts[owner]) { } else if (singleUserMode && owner && initialState?.accounts[owner]) {
redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />; redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />;
} else { } else if (showTrends) {
redirect = <Redirect from='/' to='/explore' exact />; redirect = <Redirect from='/' to='/explore' exact />;
} else {
redirect = <Redirect from='/' to='/about' exact />;
} }
return ( return (