about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/index.js
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2022-10-13 04:07:30 +0900
committerGitHub <noreply@github.com>2022-10-12 21:07:30 +0200
commit7afc6a630c76fb071bd189af3ac1366efc82f819 (patch)
treed9d1b096db2c9fd7c3c8e766ee768611e21c7630 /app/javascript/mastodon/features/ui/index.js
parent5f6c0d63e3f9e90d57204126409bbda539e352d8 (diff)
Redirect non-logged-in user to owner statuses on single user mode (#19333)
Diffstat (limited to 'app/javascript/mastodon/features/ui/index.js')
-rw-r--r--app/javascript/mastodon/features/ui/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js
index 2edd3b9fe..8333ea282 100644
--- a/app/javascript/mastodon/features/ui/index.js
+++ b/app/javascript/mastodon/features/ui/index.js
@@ -54,7 +54,7 @@ import {
   About,
   PrivacyPolicy,
 } from './util/async-components';
-import { me } from '../../initial_state';
+import initialState, { me, owner, singleUserMode } from '../../initial_state';
 import { closeOnboarding, INTRODUCTION_VERSION } from 'mastodon/actions/onboarding';
 import Header from './components/header';
 
@@ -161,6 +161,8 @@ class SwitchingColumnsArea extends React.PureComponent {
       } else {
         redirect = <Redirect from='/' to='/getting-started' exact />;
       }
+    } else if (singleUserMode && owner && initialState?.accounts[owner]) {
+      redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />;
     } else {
       redirect = <Redirect from='/' to='/explore' exact />;
     }