Add a new setting to choose the server landing page (#36588)

This commit is contained in:
Renaud Chaput 2025-10-27 11:16:59 +01:00 committed by GitHub
parent e40ca321ed
commit 779a1f8448
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
72 changed files with 81 additions and 135 deletions

View file

@ -27,7 +27,7 @@ import { uploadCompose, resetCompose, changeComposeSpoilerness } from '../../act
import { clearHeight } from '../../actions/height_cache';
import { fetchServer, fetchServerTranslationLanguages } from '../../actions/server';
import { expandHomeTimeline } from '../../actions/timelines';
import { initialState, me, owner, singleUserMode, trendsEnabled, trendsAsLanding, disableHoverCards, autoPlayGif } from '../../initial_state';
import { initialState, me, owner, singleUserMode, trendsEnabled, landingPage, localLiveFeedAccess, disableHoverCards, autoPlayGif } from '../../initial_state';
import BundleColumnError from './components/bundle_column_error';
import { NavigationBar } from './components/navigation_bar';
@ -148,8 +148,10 @@ class SwitchingColumnsArea extends PureComponent {
}
} else if (singleUserMode && owner && initialState?.accounts[owner]) {
redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />;
} else if (trendsEnabled && trendsAsLanding) {
} else if (trendsEnabled && landingPage === 'trends') {
redirect = <Redirect from='/' to='/explore' exact />;
} else if (localLiveFeedAccess === 'public' && landingPage === 'local_feed') {
redirect = <Redirect from='/' to='/public/local' exact />;
} else {
redirect = <Redirect from='/' to='/about' exact />;
}

View file

@ -39,7 +39,7 @@ interface InitialStateMeta {
remote_topic_feed_access: 'public' | 'authenticated' | 'disabled';
title: string;
show_trends: boolean;
trends_as_landing_page: boolean;
landing_page: 'about' | 'trends' | 'local_feed';
use_blurhash: boolean;
use_pending_items?: boolean;
version: string;
@ -120,7 +120,7 @@ export const remoteLiveFeedAccess = getMeta('remote_live_feed_access');
export const localTopicFeedAccess = getMeta('local_topic_feed_access');
export const remoteTopicFeedAccess = getMeta('remote_topic_feed_access');
export const title = getMeta('title');
export const trendsAsLanding = getMeta('trends_as_landing_page');
export const landingPage = getMeta('landing_page');
export const useBlurhash = getMeta('use_blurhash');
export const usePendingItems = getMeta('use_pending_items');
export const version = getMeta('version');