[Glitch] Add a new setting to choose the server landing page

Port 779a1f8448 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2025-10-27 11:16:59 +01:00
committed by Claire
parent 5f3f75559f
commit 5a051d07c6
2 changed files with 6 additions and 4 deletions

View File

@@ -30,7 +30,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';
@@ -156,8 +156,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

@@ -41,7 +41,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;
@@ -148,7 +148,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');